Store given items in correct parent folder. Fixes items given to offline avatars

not getting lost.
avinationmerge
Melanie Thielker 2010-05-03 23:44:23 +02:00
parent 9c8d7d34b3
commit 4df87631ed
1 changed files with 19 additions and 0 deletions

View File

@ -414,6 +414,25 @@ namespace OpenSim.Region.Framework.Scenes
itemCopy.BasePermissions = item.BasePermissions; itemCopy.BasePermissions = item.BasePermissions;
} }
if (itemCopy.Folder == UUID.Zero)
{
InventoryFolderBase folder = InventoryService.GetFolderForType(recipient, (AssetType)itemCopy.AssetType);
if (folder != null)
{
itemCopy.Folder = folder.ID;
}
else
{
InventoryFolderBase root = InventoryService.GetRootFolder(recipient);
if (root != null)
itemCopy.Folder = root.ID;
else
return null; // No destination
}
}
itemCopy.GroupID = UUID.Zero; itemCopy.GroupID = UUID.Zero;
itemCopy.GroupOwned = false; itemCopy.GroupOwned = false;
itemCopy.Flags = item.Flags; itemCopy.Flags = item.Flags;