aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-07-09 23:52:47 +0100
committerJustin Clark-Casey (justincc)2013-07-09 23:52:47 +0100
commitcec8e6d0f7d073d69166a7bc3594772ae51820e2 (patch)
treec1571e218c730f88f2fce134c29a4baf120c734f
parentHandle UUIDNameRequest UDP packet processing async instead of within the main... (diff)
downloadopensim-SC_OLD-cec8e6d0f7d073d69166a7bc3594772ae51820e2.zip
opensim-SC_OLD-cec8e6d0f7d073d69166a7bc3594772ae51820e2.tar.gz
opensim-SC_OLD-cec8e6d0f7d073d69166a7bc3594772ae51820e2.tar.bz2
opensim-SC_OLD-cec8e6d0f7d073d69166a7bc3594772ae51820e2.tar.xz
If a sensor is in an attachment, avoid throwing an exception if the attachee is removed from the scene before we try to retrieve them.
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 88ab515..6e74227 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -353,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
353 // Position of a sensor in a child prim attached to an avatar 353 // Position of a sensor in a child prim attached to an avatar
354 // will be still wrong. 354 // will be still wrong.
355 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 355 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
356
357 // Don't proceed if the avatar for this attachment has since been removed from the scene.
358 if (avatar == null)
359 return sensedEntities;
360
356 q = avatar.GetWorldRotation() * q; 361 q = avatar.GetWorldRotation() * q;
357 } 362 }
358 363
@@ -480,6 +485,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
480 // Position of a sensor in a child prim attached to an avatar 485 // Position of a sensor in a child prim attached to an avatar
481 // will be still wrong. 486 // will be still wrong.
482 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar); 487 ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.AttachedAvatar);
488
489 // Don't proceed if the avatar for this attachment has since been removed from the scene.
490 if (avatar == null)
491 return sensedEntities;
492
483 q = avatar.GetWorldRotation() * q; 493 q = avatar.GetWorldRotation() * q;
484 } 494 }
485 495