aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBlueWall2012-01-26 00:33:34 -0500
committerBlueWall2012-01-26 00:33:34 -0500
commita6abecf5fa5de0a78b1d77ef0aee1efafb255a2f (patch)
tree56353ccc44c4daa48eebb0e8697ade2169a60e3d
parentAdd basic TestAddScript() regression test (diff)
downloadopensim-SC_OLD-a6abecf5fa5de0a78b1d77ef0aee1efafb255a2f.zip
opensim-SC_OLD-a6abecf5fa5de0a78b1d77ef0aee1efafb255a2f.tar.gz
opensim-SC_OLD-a6abecf5fa5de0a78b1d77ef0aee1efafb255a2f.tar.bz2
opensim-SC_OLD-a6abecf5fa5de0a78b1d77ef0aee1efafb255a2f.tar.xz
Change references from sop to sog and add protection from null ref
I had code made additions to the map module that was based on the earlier work that I did before Melanie made improvements. Updating the new code to incorporate the same changes.
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs24
1 files changed, 13 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 1a9313b..4ae96f0 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -489,18 +489,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
489 List<mapItemReply> mapitems = new List<mapItemReply>(); 489 List<mapItemReply> mapitems = new List<mapItemReply>();
490 mapItemReply mapitem = new mapItemReply(); 490 mapItemReply mapitem = new mapItemReply();
491 491
492 SceneObjectPart sop = m_scene.GetSceneObjectPart(m_scene.RegionInfo.RegionSettings.TelehubObject); 492 SceneObjectGroup sog = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
493 493 if (sog != null)
494 mapitem = new mapItemReply(); 494 {
495 mapitem.x = (uint)(xstart + sop.AbsolutePosition.X); 495 mapitem = new mapItemReply();
496 mapitem.y = (uint)(ystart + sop.AbsolutePosition.Y); 496 mapitem.x = (uint)(xstart + sog.AbsolutePosition.X);
497 mapitem.id = UUID.Zero; 497 mapitem.y = (uint)(ystart + sog.AbsolutePosition.Y);
498 mapitem.name = sop.Name; 498 mapitem.id = UUID.Zero;
499 mapitem.Extra = 0; // color (not used) 499 mapitem.name = sog.Name;
500 mapitem.Extra2 = 0; // 0 = telehub / 1 = infohub 500 mapitem.Extra = 0; // color (not used)
501 mapitems.Add(mapitem); 501 mapitem.Extra2 = 0; // 0 = telehub / 1 = infohub
502 mapitems.Add(mapitem);
502 503
503 remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags); 504 remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags);
505 }
504 } 506 }
505 else 507 else
506 { 508 {