From 04612f41a77ed8c8c20ce435b36b6439e2398e9d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 16 Oct 2014 03:46:45 +0200 Subject: [PATCH] Fix transferring inventory from prims to agent inventory --- .../Region/Framework/Scenes/Scene.Inventory.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3489873836..3c120ffeca 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1227,16 +1227,21 @@ namespace OpenSim.Region.Framework.Scenes agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); if (taskItem.InvType == (int)InventoryType.Object) { - uint perms = taskItem.CurrentPermissions; + // Bake the new base permissions from folded permissions + // The folded perms are in the lowest 3 bits of the current perms + // We use base permissions here to avoid baking the "Locked" status + // into the item as it is passed. + uint perms = taskItem.BasePermissions & taskItem.NextPermissions; PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); + // Avoid the "lock trap" - move must always be enabled but the above may remove it + // Add it back here. agentItem.BasePermissions = perms | (uint)PermissionMask.Move; - agentItem.CurrentPermissions = agentItem.BasePermissions; - } - else - { - agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; + // Newly given items cannot be "locked" on rez. Make sure by + // setting current equal to base. } + agentItem.CurrentPermissions = agentItem.BasePermissions; + agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; agentItem.NextPermissions = taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);