From bd5d2cb043892399baff85667ee1e6ec6f3b3d2e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 8 Sep 2011 20:51:52 +0100 Subject: Use scene presence agent id for rezzed object ownership rather than item owner. These should be identical. However, the item isn't available when rezzing npc attachments. --- .../InventoryAccess/InventoryAccessModule.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 4e8466d..03238d9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -724,8 +724,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess SceneObjectGroup group = null; string xmlData = Utils.BytesToString(rezAsset.Data); - List objlist = - new List(); + List objlist = new List(); List veclist = new List(); byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); Vector3 pos; @@ -797,6 +796,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess m_log.Debug("[InventoryAccessModule]: Object has UUID.Zero! Position 3"); } + foreach (SceneObjectPart part in group.Parts) + { + // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. + part.LastOwnerID = part.OwnerID; + part.OwnerID = remoteClient.AgentId; + } + if (!attachment) { // If it's rezzed in world, select it. Much easier to @@ -833,13 +839,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess group.AbsolutePosition = pos + veclist[i]; } - SceneObjectPart rootPart = group.RootPart; - group.SetGroup(remoteClient.ActiveGroupId, remoteClient); if (!attachment) { - if (group.RootPart.Shape.PCode == (byte)PCode.Prim) + SceneObjectPart rootPart = group.RootPart; + + if (rootPart.Shape.PCode == (byte)PCode.Prim) group.ClearPartAttachmentData(); // Fire on_rez @@ -963,11 +969,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) { - part.LastOwnerID = part.OwnerID; - part.OwnerID = item.Owner; part.Inventory.ChangeInventoryOwner(item.Owner); part.GroupMask = 0; // DO NOT propagate here } + part.EveryoneMask = item.EveryOnePermissions; part.NextOwnerMask = item.NextPermissions; } -- cgit v1.1