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

not getting lost.
slimupdates
Melanie Thielker 2010-05-03 23:44:23 +02:00 committed by Melanie
parent 1494c84f56
commit 92561aef8d
1 changed files with 19 additions and 0 deletions

View File

@ -415,6 +415,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;