Thank you kindly, Idb for a patch that solves:
lsl conformity, llPushObject incorrectly restricts the pushing of objects based on region and parcel flags0.6.0-stable
parent
a5d945e199
commit
e9134a050a
|
@ -3480,55 +3480,48 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ScenePresence pusheeav = null;
|
ScenePresence pusheeav = null;
|
||||||
//SceneObjectPart pusheeob = null;
|
|
||||||
EntityBase obj = null;
|
|
||||||
Vector3 PusheePos = Vector3.Zero;
|
Vector3 PusheePos = Vector3.Zero;
|
||||||
SceneObjectPart pusheeob = null;
|
SceneObjectPart pusheeob = null;
|
||||||
|
|
||||||
List<ScenePresence> avatars = World.GetAvatars();
|
|
||||||
|
|
||||||
foreach (ScenePresence avatar in avatars)
|
ScenePresence avatar = World.GetScenePresence(targetID);
|
||||||
|
if (avatar != null)
|
||||||
{
|
{
|
||||||
if (avatar.UUID == targetID)
|
pusheeIsAvatar = true;
|
||||||
|
|
||||||
|
// Pushee doesn't have a physics actor
|
||||||
|
if (avatar.PhysicsActor == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Pushee is in GodMode this pushing object isn't owned by them
|
||||||
|
if (avatar.GodLevel > 0 && m_host.OwnerID != targetID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pusheeav = avatar;
|
||||||
|
|
||||||
|
// Find pushee position
|
||||||
|
// Pushee Linked?
|
||||||
|
if (pusheeav.ParentID != 0)
|
||||||
{
|
{
|
||||||
pusheeIsAvatar = true;
|
SceneObjectPart parentobj = World.GetSceneObjectPart(pusheeav.ParentID);
|
||||||
|
if (parentobj != null)
|
||||||
// Pushee doesn't have a physics actor
|
|
||||||
if (avatar.PhysicsActor == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Pushee is in GodMode this pushing object isn't owned by them
|
|
||||||
if (avatar.GodLevel > 0 && m_host.OwnerID != targetID)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pusheeav = avatar;
|
|
||||||
|
|
||||||
// Find pushee position
|
|
||||||
// Pushee Linked?
|
|
||||||
if (pusheeav.ParentID != 0)
|
|
||||||
{
|
{
|
||||||
SceneObjectPart parentobj = World.GetSceneObjectPart(pusheeav.ParentID);
|
PusheePos = parentobj.AbsolutePosition;
|
||||||
if (parentobj != null)
|
|
||||||
{
|
|
||||||
PusheePos = parentobj.AbsolutePosition;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PusheePos = pusheeav.AbsolutePosition;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PusheePos = pusheeav.AbsolutePosition;
|
PusheePos = pusheeav.AbsolutePosition;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
obj = (EntityBase)pusheeav;
|
else
|
||||||
break;
|
{
|
||||||
|
PusheePos = pusheeav.AbsolutePosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pusheeIsAvatar)
|
if (!pusheeIsAvatar)
|
||||||
{
|
{
|
||||||
|
// not an avatar so push is not affected by parcel flags
|
||||||
pusheeob = World.GetSceneObjectPart((UUID)target);
|
pusheeob = World.GetSceneObjectPart((UUID)target);
|
||||||
|
|
||||||
// We can't find object
|
// We can't find object
|
||||||
|
@ -3540,50 +3533,51 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PusheePos = pusheeob.AbsolutePosition;
|
PusheePos = pusheeob.AbsolutePosition;
|
||||||
//obj = (EntityBase)pusheeob;
|
pushAllowed = true;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (pushrestricted)
|
|
||||||
{
|
|
||||||
ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X,PusheePos.Y);
|
|
||||||
|
|
||||||
// We didn't find the parcel but region is push restricted so assume it is NOT ok
|
|
||||||
if (targetlandObj == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Need provisions for Group Owned here
|
|
||||||
if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID)
|
|
||||||
{
|
|
||||||
pushAllowed = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y);
|
if (pushrestricted)
|
||||||
if (targetlandObj == null)
|
|
||||||
{
|
{
|
||||||
// We didn't find the parcel but region isn't push restricted so assume it's ok
|
ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y);
|
||||||
pushAllowed = true;
|
|
||||||
|
// We didn't find the parcel but region is push restricted so assume it is NOT ok
|
||||||
|
if (targetlandObj == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Need provisions for Group Owned here
|
||||||
|
if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID)
|
||||||
|
{
|
||||||
|
pushAllowed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Parcel push restriction
|
ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y);
|
||||||
if ((targetlandObj.landData.Flags & (uint)Parcel.ParcelFlags.RestrictPushObject) == (uint)Parcel.ParcelFlags.RestrictPushObject)
|
if (targetlandObj == null)
|
||||||
{
|
{
|
||||||
// Need provisions for Group Owned here
|
// We didn't find the parcel but region isn't push restricted so assume it's ok
|
||||||
if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID)
|
pushAllowed = true;
|
||||||
{
|
|
||||||
pushAllowed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Parcel.ParcelFlags.RestrictPushObject
|
|
||||||
//pushAllowed = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Parcel isn't push restricted
|
// Parcel push restriction
|
||||||
pushAllowed = true;
|
if ((targetlandObj.landData.Flags & (uint)Parcel.ParcelFlags.RestrictPushObject) == (uint)Parcel.ParcelFlags.RestrictPushObject)
|
||||||
|
{
|
||||||
|
// Need provisions for Group Owned here
|
||||||
|
if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID)
|
||||||
|
{
|
||||||
|
pushAllowed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Parcel.ParcelFlags.RestrictPushObject
|
||||||
|
//pushAllowed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Parcel isn't push restricted
|
||||||
|
pushAllowed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue