diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f7c44d1..b87bf5a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3453,7 +3453,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3453 | { | 3453 | { |
3454 | if (!m_host.ParentGroup.IsDeleted) | 3454 | if (!m_host.ParentGroup.IsDeleted) |
3455 | { | 3455 | { |
3456 | m_host.ParentGroup.RootPart.SetBuoyancy((float)buoyancy); | 3456 | m_host.ParentGroup.RootPart.Buoyancy = (float)buoyancy; |
3457 | } | 3457 | } |
3458 | } | 3458 | } |
3459 | } | 3459 | } |
@@ -3707,27 +3707,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3707 | return; | 3707 | return; |
3708 | } | 3708 | } |
3709 | } | 3709 | } |
3710 | else if (m_host.SitTargetAvatar == agentID) // Sitting avatar | 3710 | else |
3711 | { | 3711 | { |
3712 | // When agent is sitting, certain permissions are implicit if requested from sitting agent | 3712 | bool sitting = false; |
3713 | int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | | 3713 | if (m_host.SitTargetAvatar == agentID) |
3714 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | | 3714 | { |
3715 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | | 3715 | sitting = true; |
3716 | ScriptBaseClass.PERMISSION_TAKE_CONTROLS; | 3716 | } |
3717 | else | ||
3718 | { | ||
3719 | foreach (SceneObjectPart p in m_host.ParentGroup.Parts) | ||
3720 | { | ||
3721 | if (p.SitTargetAvatar == agentID) | ||
3722 | sitting = true; | ||
3723 | } | ||
3724 | } | ||
3717 | 3725 | ||
3718 | if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms | 3726 | if (sitting) |
3719 | { | 3727 | { |
3720 | m_host.TaskInventory.LockItemsForWrite(true); | 3728 | // When agent is sitting, certain permissions are implicit if requested from sitting agent |
3721 | m_host.TaskInventory[invItemID].PermsGranter = agentID; | 3729 | int implicitPerms = ScriptBaseClass.PERMISSION_TRIGGER_ANIMATION | |
3722 | m_host.TaskInventory[invItemID].PermsMask = perm; | 3730 | ScriptBaseClass.PERMISSION_CONTROL_CAMERA | |
3723 | m_host.TaskInventory.LockItemsForWrite(false); | 3731 | ScriptBaseClass.PERMISSION_TRACK_CAMERA | |
3732 | ScriptBaseClass.PERMISSION_TAKE_CONTROLS; | ||
3724 | 3733 | ||
3725 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( | 3734 | if ((perm & (~implicitPerms)) == 0) // Requested only implicit perms |
3726 | "run_time_permissions", new Object[] { | 3735 | { |
3727 | new LSL_Integer(perm) }, | 3736 | m_host.TaskInventory.LockItemsForWrite(true); |
3728 | new DetectParams[0])); | 3737 | m_host.TaskInventory[invItemID].PermsGranter = agentID; |
3738 | m_host.TaskInventory[invItemID].PermsMask = perm; | ||
3739 | m_host.TaskInventory.LockItemsForWrite(false); | ||
3729 | 3740 | ||
3730 | return; | 3741 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( |
3742 | "run_time_permissions", new Object[] { | ||
3743 | new LSL_Integer(perm) }, | ||
3744 | new DetectParams[0])); | ||
3745 | |||
3746 | return; | ||
3747 | } | ||
3731 | } | 3748 | } |
3732 | } | 3749 | } |
3733 | 3750 | ||