diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 124 |
1 files changed, 59 insertions, 65 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d410a59..2f5337f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3480,57 +3480,50 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3480 | return; | 3480 | return; |
3481 | 3481 | ||
3482 | ScenePresence pusheeav = null; | 3482 | ScenePresence pusheeav = null; |
3483 | //SceneObjectPart pusheeob = null; | ||
3484 | EntityBase obj = null; | ||
3485 | Vector3 PusheePos = Vector3.Zero; | 3483 | Vector3 PusheePos = Vector3.Zero; |
3486 | SceneObjectPart pusheeob = null; | 3484 | SceneObjectPart pusheeob = null; |
3487 | 3485 | ||
3488 | List<ScenePresence> avatars = World.GetAvatars(); | ||
3489 | 3486 | ||
3490 | foreach (ScenePresence avatar in avatars) | 3487 | ScenePresence avatar = World.GetScenePresence(targetID); |
3488 | if (avatar != null) | ||
3491 | { | 3489 | { |
3492 | if (avatar.UUID == targetID) | 3490 | pusheeIsAvatar = true; |
3493 | { | ||
3494 | pusheeIsAvatar = true; | ||
3495 | 3491 | ||
3496 | // Pushee doesn't have a physics actor | 3492 | // Pushee doesn't have a physics actor |
3497 | if (avatar.PhysicsActor == null) | 3493 | if (avatar.PhysicsActor == null) |
3498 | return; | 3494 | return; |
3499 | 3495 | ||
3500 | // Pushee is in GodMode this pushing object isn't owned by them | 3496 | // Pushee is in GodMode this pushing object isn't owned by them |
3501 | if (avatar.GodLevel > 0 && m_host.OwnerID != targetID) | 3497 | if (avatar.GodLevel > 0 && m_host.OwnerID != targetID) |
3502 | return; | 3498 | return; |
3503 | 3499 | ||
3504 | pusheeav = avatar; | 3500 | pusheeav = avatar; |
3505 | 3501 | ||
3506 | // Find pushee position | 3502 | // Find pushee position |
3507 | // Pushee Linked? | 3503 | // Pushee Linked? |
3508 | if (pusheeav.ParentID != 0) | 3504 | if (pusheeav.ParentID != 0) |
3505 | { | ||
3506 | SceneObjectPart parentobj = World.GetSceneObjectPart(pusheeav.ParentID); | ||
3507 | if (parentobj != null) | ||
3509 | { | 3508 | { |
3510 | SceneObjectPart parentobj = World.GetSceneObjectPart(pusheeav.ParentID); | 3509 | PusheePos = parentobj.AbsolutePosition; |
3511 | if (parentobj != null) | ||
3512 | { | ||
3513 | PusheePos = parentobj.AbsolutePosition; | ||
3514 | } | ||
3515 | else | ||
3516 | { | ||
3517 | PusheePos = pusheeav.AbsolutePosition; | ||
3518 | } | ||
3519 | } | 3510 | } |
3520 | else | 3511 | else |
3521 | { | 3512 | { |
3522 | PusheePos = pusheeav.AbsolutePosition; | 3513 | PusheePos = pusheeav.AbsolutePosition; |
3523 | } | 3514 | } |
3524 | 3515 | } | |
3525 | obj = (EntityBase)pusheeav; | 3516 | else |
3526 | break; | 3517 | { |
3518 | PusheePos = pusheeav.AbsolutePosition; | ||
3527 | } | 3519 | } |
3528 | } | 3520 | } |
3529 | 3521 | ||
3530 | if (!pusheeIsAvatar) | 3522 | if (!pusheeIsAvatar) |
3531 | { | 3523 | { |
3524 | // not an avatar so push is not affected by parcel flags | ||
3532 | pusheeob = World.GetSceneObjectPart((UUID)target); | 3525 | pusheeob = World.GetSceneObjectPart((UUID)target); |
3533 | 3526 | ||
3534 | // We can't find object | 3527 | // We can't find object |
3535 | if (pusheeob == null) | 3528 | if (pusheeob == null) |
3536 | return; | 3529 | return; |
@@ -3540,50 +3533,51 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3540 | return; | 3533 | return; |
3541 | 3534 | ||
3542 | PusheePos = pusheeob.AbsolutePosition; | 3535 | PusheePos = pusheeob.AbsolutePosition; |
3543 | //obj = (EntityBase)pusheeob; | 3536 | pushAllowed = true; |
3544 | } | ||
3545 | |||
3546 | |||
3547 | if (pushrestricted) | ||
3548 | { | ||
3549 | ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X,PusheePos.Y); | ||
3550 | |||
3551 | // We didn't find the parcel but region is push restricted so assume it is NOT ok | ||
3552 | if (targetlandObj == null) | ||
3553 | return; | ||
3554 | |||
3555 | // Need provisions for Group Owned here | ||
3556 | if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) | ||
3557 | { | ||
3558 | pushAllowed = true; | ||
3559 | } | ||
3560 | } | 3537 | } |
3561 | else | 3538 | else |
3562 | { | 3539 | { |
3563 | ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y); | 3540 | if (pushrestricted) |
3564 | if (targetlandObj == null) | ||
3565 | { | 3541 | { |
3566 | // We didn't find the parcel but region isn't push restricted so assume it's ok | 3542 | ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y); |
3567 | pushAllowed = true; | 3543 | |
3544 | // We didn't find the parcel but region is push restricted so assume it is NOT ok | ||
3545 | if (targetlandObj == null) | ||
3546 | return; | ||
3547 | |||
3548 | // Need provisions for Group Owned here | ||
3549 | if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) | ||
3550 | { | ||
3551 | pushAllowed = true; | ||
3552 | } | ||
3568 | } | 3553 | } |
3569 | else | 3554 | else |
3570 | { | 3555 | { |
3571 | // Parcel push restriction | 3556 | ILandObject targetlandObj = World.LandChannel.GetLandObject(PusheePos.X, PusheePos.Y); |
3572 | if ((targetlandObj.landData.Flags & (uint)Parcel.ParcelFlags.RestrictPushObject) == (uint)Parcel.ParcelFlags.RestrictPushObject) | 3557 | if (targetlandObj == null) |
3573 | { | 3558 | { |
3574 | // Need provisions for Group Owned here | 3559 | // We didn't find the parcel but region isn't push restricted so assume it's ok |
3575 | if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) | 3560 | pushAllowed = true; |
3576 | { | ||
3577 | pushAllowed = true; | ||
3578 | } | ||
3579 | |||
3580 | //Parcel.ParcelFlags.RestrictPushObject | ||
3581 | //pushAllowed = true; | ||
3582 | } | 3561 | } |
3583 | else | 3562 | else |
3584 | { | 3563 | { |
3585 | // Parcel isn't push restricted | 3564 | // Parcel push restriction |
3586 | pushAllowed = true; | 3565 | if ((targetlandObj.landData.Flags & (uint)Parcel.ParcelFlags.RestrictPushObject) == (uint)Parcel.ParcelFlags.RestrictPushObject) |
3566 | { | ||
3567 | // Need provisions for Group Owned here | ||
3568 | if (m_host.OwnerID == targetlandObj.landData.OwnerID || targetlandObj.landData.IsGroupOwned || m_host.OwnerID == targetID) | ||
3569 | { | ||
3570 | pushAllowed = true; | ||
3571 | } | ||
3572 | |||
3573 | //Parcel.ParcelFlags.RestrictPushObject | ||
3574 | //pushAllowed = true; | ||
3575 | } | ||
3576 | else | ||
3577 | { | ||
3578 | // Parcel isn't push restricted | ||
3579 | pushAllowed = true; | ||
3580 | } | ||
3587 | } | 3581 | } |
3588 | } | 3582 | } |
3589 | } | 3583 | } |