From 59e3ac1ec65d8168716d8cada5164952a0e576cf Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 12 Oct 2011 00:50:13 +0200 Subject: [PATCH] Fix rezzing coalesced object broken by core merge --- .../InventoryAccess/InventoryAccessModule.cs | 90 ++++++++----------- 1 file changed, 36 insertions(+), 54 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index dd6bdf7c11..e0f82401dd 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -786,10 +786,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment)) return null; - SceneObjectPart rootPart = group.RootPart; for (int i = 0; i < objlist.Count; i++) { group = objlist[i]; + SceneObjectPart rootPart = group.RootPart; // Vector3 storedPosition = group.AbsolutePosition; if (group.UUID == UUID.Zero) @@ -854,6 +854,40 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess rootPart.ScheduleFullUpdate(); } + if ((rootPart.OwnerID != item.Owner) || + (item.CurrentPermissions & 16) != 0 || // Magic number + (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) + { + //Need to kill the for sale here + rootPart.ObjectSaleType = 0; + rootPart.SalePrice = 10; + + if (m_Scene.Permissions.PropagatePermissions()) + { + foreach (SceneObjectPart part in group.Parts) + { + if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) + { + if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) + part.EveryoneMask = item.EveryOnePermissions; + if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) + part.NextOwnerMask = item.NextPermissions; + if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) + part.GroupMask = item.GroupPermissions; + } + } + + foreach (SceneObjectPart part in group.Parts) + { + part.LastOwnerID = part.OwnerID; + part.OwnerID = item.Owner; + part.Inventory.ChangeInventoryOwner(item.Owner); + } + + group.ApplyNextOwnerPermissions(); + } + } + // m_log.DebugFormat( // "[InventoryAccessModule]: Rezzed {0} {1} {2} for {3}", // group.Name, group.LocalId, group.UUID, remoteClient.Name); @@ -864,58 +898,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (item != null) DoPostRezWhenFromItem(item, attachment); - if ((rootPart.OwnerID != item.Owner) || - (item.CurrentPermissions & 16) != 0 || // Magic number - (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) - { - //Need to kill the for sale here - rootPart.ObjectSaleType = 0; - rootPart.SalePrice = 10; - - if (m_Scene.Permissions.PropagatePermissions()) - { - foreach (SceneObjectPart part in group.Parts) - { - if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) - { - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) - part.EveryoneMask = item.EveryOnePermissions; - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) - part.NextOwnerMask = item.NextPermissions; - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) - part.GroupMask = item.GroupPermissions; - } - } - - foreach (SceneObjectPart part in group.Parts) - { - part.LastOwnerID = part.OwnerID; - part.OwnerID = item.Owner; - part.Inventory.ChangeInventoryOwner(item.Owner); - } - - group.ApplyNextOwnerPermissions(); - } - } - foreach (SceneObjectPart part in group.Parts) - { - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) - part.EveryoneMask = item.EveryOnePermissions; - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) - part.NextOwnerMask = item.NextPermissions; - if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) - part.GroupMask = item.GroupPermissions; - } - - if ((rootPart.OwnerID != item.Owner) || - (item.CurrentPermissions & 16) != 0 || // Magic number - (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) - { - //Need to kill the for sale here - rootPart.ObjectSaleType = 0; - rootPart.SalePrice = 10; - } - return group; } @@ -1165,4 +1147,4 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess #endregion } -} \ No newline at end of file +}