From bf17da3d6182e7b5621318a220aa229036db98a1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 21 Sep 2016 22:51:25 +0100 Subject: check for null target, minor cleanup --- .../Scripting/WorldComm/WorldCommModule.cs | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 483c25f..e314730 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -374,9 +374,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm if (channel == DEBUG_CHANNEL) return; - // Is id an avatar? - ScenePresence sp = m_scene.GetScenePresence(target); + if(target == UUID.Zero) + return; + // Is target an avatar? + ScenePresence sp = m_scene.GetScenePresence(target); if (sp != null) { // Send message to avatar @@ -407,13 +409,13 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm // Need to check each attachment foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) { - if (li.GetHostID().Equals(id)) + UUID liHostID = li.GetHostID(); + if (liHostID.Equals(id)) continue; - - if (m_scene.GetSceneObjectPart(li.GetHostID()) == null) + if (m_scene.GetSceneObjectPart(liHostID) == null) continue; - - if (targets.Contains(li.GetHostID())) + + if (targets.Contains(liHostID)) QueueMessage(new ListenerInfo(li, name, id, msg)); } @@ -426,16 +428,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) { + UUID liHostID = li.GetHostID(); // Dont process if this message is from yourself! - if (li.GetHostID().Equals(id)) + if (liHostID.Equals(id)) continue; - SceneObjectPart sPart = m_scene.GetSceneObjectPart( - li.GetHostID()); - if (sPart == null) + if (m_scene.GetSceneObjectPart(liHostID) == null) continue; - if (li.GetHostID().Equals(target)) + if (liHostID.Equals(target)) { QueueMessage(new ListenerInfo(li, name, id, msg)); break; -- cgit v1.1 From bbe8ef0528248c64026aa262676c11b0448b68a8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 22 Sep 2016 02:05:25 +0100 Subject: mantis 8027: allow messages to be sent to attachments child prims in llRegionSayTo --- OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index e314730..e1c0cd7 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -403,10 +403,13 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm foreach (SceneObjectGroup sog in attachments) { if (!sog.IsDeleted) - targets.Add(sog.UUID); + { + SceneObjectPart[] parts = sog.Parts; + foreach(SceneObjectPart p in parts) + targets.Add(p.UUID); + } } - // Need to check each attachment foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) { UUID liHostID = li.GetHostID(); -- cgit v1.1