Thank you Justin for a patch that solves the issue of: When a sensor detects an Avatar,

and llDetectedOwner is called on the script, the current implementation attempts to 
find the detected avatar as a SceneObjectPart and return the owner of that part.
0.6.0-stable
Charles Krinke 2008-04-10 15:38:33 +00:00
parent 4bdb4a2646
commit f565f44d89
1 changed files with 14 additions and 4 deletions

View File

@ -509,11 +509,21 @@ namespace OpenSim.Region.ScriptEngine.Common
EntityBase SensedObject = entityDetectedKey(number); EntityBase SensedObject = entityDetectedKey(number);
if (SensedObject ==null) if (SensedObject ==null)
return String.Empty; return String.Empty;
//return SensedObject.O .Name; // What is the owner of the object ?
//EntityBase SensedObject = World.GetScenePresence(SensedUUID);
LLUUID SensedUUID = uuidDetectedKey(number); LLUUID SensedUUID = uuidDetectedKey(number);
if (World.GetScenePresence(SensedUUID) == null)
{
// sensed object is not an avatar
// so get the owner of the sensed object
SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID); SceneObjectPart SOP = World.GetSceneObjectPart(SensedUUID);
if (SOP != null) { return SOP.ObjectOwner.ToString(); } if (SOP != null) { return SOP.ObjectOwner.ToString(); }
}
else
{
// sensed object is an avatar, and so must be its own owner
return SensedUUID.ToString();
}
return String.Empty; return String.Empty;
} }