aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs18
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index a070248..6a0b3e2 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -509,11 +509,21 @@ namespace OpenSim.Region.ScriptEngine.Common
509 EntityBase SensedObject = entityDetectedKey(number); 509 EntityBase SensedObject = entityDetectedKey(number);
510 if (SensedObject ==null) 510 if (SensedObject ==null)
511 return String.Empty; 511 return String.Empty;
512 //return SensedObject.O .Name; // What is the owner of the object ?
513 //EntityBase SensedObject = World.GetScenePresence(SensedUUID);
514 LLUUID SensedUUID = uuidDetectedKey(number); 512 LLUUID SensedUUID = uuidDetectedKey(number);
515 SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID); 513 if (World.GetScenePresence(SensedUUID) == null)
516 if (SOP != null) { return SOP.ObjectOwner.ToString(); } 514 {
515 // sensed object is not an avatar
516 // so get the owner of the sensed object
517 SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID);
518 if (SOP != null) { return SOP.ObjectOwner.ToString(); }
519 }
520 else
521 {
522 // sensed object is an avatar, and so must be its own owner
523 return SensedUUID.ToString();
524 }
525
526
517 return String.Empty; 527 return String.Empty;
518 528
519 } 529 }