make sensors detect sitting avatars also by the distance to the root prim

of the object as sl does (as sl avatar needs to be in the arc)
avinationmerge
UbitUmarov 2014-08-10 22:13:39 +01:00
parent 7fcd1068e7
commit 67a91ee314
1 changed files with 10 additions and 1 deletions

View File

@ -549,7 +549,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
return; return;
toRegionPos = presence.AbsolutePosition; toRegionPos = presence.AbsolutePosition;
dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); dis = Util.GetDistanceTo(toRegionPos, fromRegionPos);
if (presence.IsSatOnObject && presence.ParentPart != null &&
presence.ParentPart.ParentGroup != null &&
presence.ParentPart.ParentGroup.RootPart != null)
{
Vector3 rpos = presence.ParentPart.ParentGroup.RootPart.AbsolutePosition;
double dis2 = Util.GetDistanceTo(rpos, fromRegionPos);
if (dis > dis2)
dis = dis2;
}
// Disabled for now since all osNpc* methods check for appropriate ownership permission. // Disabled for now since all osNpc* methods check for appropriate ownership permission.
// Perhaps could be re-enabled as an NPC setting at some point since being able to make NPCs not // Perhaps could be re-enabled as an NPC setting at some point since being able to make NPCs not