From cc14055e06e9b594e2db3a0d367bd7a86a171ca6 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 3 Aug 2021 14:03:27 +1000 Subject: Backported from 0.9.2 fix owner on user rez from a prim inventory to ground With some minor fixes. --- .../Framework/Scenes/SceneObjectPartInventory.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 8c880fc..dca22ea 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -895,6 +895,11 @@ namespace OpenSim.Region.Framework.Scenes public bool GetRezReadySceneObjects(TaskInventoryItem item, out List objlist, out List veclist, out Vector3 bbox, out float offsetHeight) { + return GetRezReadySceneObjects(item, item.OwnerID, m_part.GroupID, out objlist, out veclist, out bbox, out offsetHeight); + } + + public bool GetRezReadySceneObjects(TaskInventoryItem item, UUID NewOwner, UUID NewGroup, out List objlist, out List veclist, out Vector3 bbox, out float offsetHeight) + { AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); if (null == rezAsset) @@ -909,7 +914,7 @@ namespace OpenSim.Region.Framework.Scenes return false; } - bool single = m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); + m_part.ParentGroup.Scene.GetObjectsToRez(rezAsset.Data, false, out objlist, out veclist, out bbox, out offsetHeight); for (int i = 0; i < objlist.Count; i++) { @@ -952,11 +957,11 @@ namespace OpenSim.Region.Framework.Scenes } */ // old code start + group.SetGroup(NewGroup, null); SceneObjectPart[] partList = group.Parts; - group.SetGroup(m_part.GroupID, null); - - if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) + bool slamThings = (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0; + if ((rootPart.OwnerID != NewOwner) || slamThings) { if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) { @@ -976,12 +981,12 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart part in partList) { - if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) + if ((part.OwnerID != NewOwner)) { if(part.GroupID != part.OwnerID) part.LastOwnerID = part.OwnerID; - part.OwnerID = item.OwnerID; - part.Inventory.ChangeInventoryOwner(item.OwnerID); + part.OwnerID = NewOwner; + part.Inventory.ChangeInventoryOwner(NewOwner); } if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) -- cgit v1.1