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.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-09-08 20:51:52 +01:00
parent 3e7960d161
commit bd5d2cb043
3 changed files with 90 additions and 9 deletions

View File

@@ -724,8 +724,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
SceneObjectGroup group = null;
string xmlData = Utils.BytesToString(rezAsset.Data);
List<SceneObjectGroup> objlist =
new List<SceneObjectGroup>();
List<SceneObjectGroup> objlist = new List<SceneObjectGroup>();
List<Vector3> veclist = new List<Vector3>();
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;
}