Fix rezzing coalesced object broken by core merge

avinationmerge
Melanie 2011-10-12 00:50:13 +02:00
parent 1c2b5d99c9
commit 59e3ac1ec6
1 changed files with 36 additions and 54 deletions

View File

@ -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;
}