diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index dd45406..64dc2e2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -353,7 +353,12 @@ 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 | q = avatar.Rotation * q; | 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 | |||
361 | q = avatar.GetWorldRotation() * q; | ||
357 | } | 362 | } |
358 | 363 | ||
359 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); | 364 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); |
@@ -362,7 +367,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
362 | 367 | ||
363 | Vector3 ZeroVector = new Vector3(0, 0, 0); | 368 | Vector3 ZeroVector = new Vector3(0, 0, 0); |
364 | 369 | ||
365 | bool nameSearch = (ts.name != null && ts.name != ""); | 370 | bool nameSearch = !string.IsNullOrEmpty(ts.name); |
366 | 371 | ||
367 | foreach (EntityBase ent in Entities) | 372 | foreach (EntityBase ent in Entities) |
368 | { | 373 | { |
@@ -480,7 +485,12 @@ 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); |
483 | q = avatar.Rotation * q; | 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 | |||
493 | q = avatar.GetWorldRotation() * q; | ||
484 | } | 494 | } |
485 | 495 | ||
486 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); | 496 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q); |
@@ -595,7 +605,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
595 | return sensedEntities; | 605 | return sensedEntities; |
596 | senseEntity(sp); | 606 | senseEntity(sp); |
597 | } | 607 | } |
598 | else if (ts.name != null && ts.name != "") | 608 | else if (!string.IsNullOrEmpty(ts.name)) |
599 | { | 609 | { |
600 | ScenePresence sp; | 610 | ScenePresence sp; |
601 | // Try lookup by name will return if/when found | 611 | // Try lookup by name will return if/when found |