diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index b4fc472..8893cc0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -916,48 +916,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
916 | // Since renaming the item in the inventory does not affect the name stored | 916 | // Since renaming the item in the inventory does not affect the name stored |
917 | // in the serialization, transfer the correct name from the inventory to the | 917 | // in the serialization, transfer the correct name from the inventory to the |
918 | // object itself before we rez. | 918 | // object itself before we rez. |
919 | rootPart.Name = item.Name; | 919 | // Only do these for the first object if we are rezzing a coalescence. |
920 | rootPart.Description = item.Description; | 920 | if (i == 0) |
921 | |||
922 | SceneObjectPart[] partList = group.Parts; | ||
923 | |||
924 | group.SetGroup(m_part.GroupID, null); | ||
925 | |||
926 | // TODO: Remove magic number badness | ||
927 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
928 | { | 921 | { |
929 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) | 922 | rootPart.Name = item.Name; |
930 | { | 923 | rootPart.Description = item.Description; |
931 | foreach (SceneObjectPart part in partList) | ||
932 | { | ||
933 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | ||
934 | part.EveryoneMask = item.EveryonePermissions; | ||
935 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
936 | part.NextOwnerMask = item.NextPermissions; | ||
937 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
938 | part.GroupMask = item.GroupPermissions; | ||
939 | } | ||
940 | |||
941 | group.ApplyNextOwnerPermissions(); | ||
942 | } | ||
943 | } | 924 | } |
944 | 925 | ||
945 | foreach (SceneObjectPart part in partList) | 926 | group.SetGroup(m_part.GroupID, null); |
946 | { | ||
947 | // TODO: Remove magic number badness | ||
948 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
949 | { | ||
950 | part.LastOwnerID = part.OwnerID; | ||
951 | part.OwnerID = item.OwnerID; | ||
952 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | ||
953 | } | ||
954 | 927 | ||
955 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | 928 | foreach (SceneObjectPart part in group.Parts) |
956 | part.EveryoneMask = item.EveryonePermissions; | 929 | { |
957 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | 930 | // Convert between InventoryItem classes. You can never have too many similar but slightly different classes :) |
958 | part.NextOwnerMask = item.NextPermissions; | 931 | InventoryItemBase dest = new InventoryItemBase(item.ItemID, item.OwnerID); |
959 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | 932 | dest.BasePermissions = item.BasePermissions; |
960 | part.GroupMask = item.GroupPermissions; | 933 | dest.CurrentPermissions = item.CurrentPermissions; |
934 | dest.EveryOnePermissions = item.EveryonePermissions; | ||
935 | dest.GroupPermissions = item.GroupPermissions; | ||
936 | dest.NextPermissions = item.NextPermissions; | ||
937 | dest.Flags = item.Flags; | ||
938 | |||
939 | part.ApplyPermissionsOnRez(dest, false, m_part.ParentGroup.Scene); | ||
961 | } | 940 | } |
962 | 941 | ||
963 | rootPart.TrimPermissions(); | 942 | rootPart.TrimPermissions(); |