mantis 8419: TakeCopy now sends to objects; Take to a child of trash or lostandfound also, else goes to original folder

0.9.1.0-post-fixes
UbitUmarov 2018-12-10 06:23:38 +00:00
parent 043a213302
commit 6297717399
1 changed files with 21 additions and 6 deletions

View File

@ -748,20 +748,35 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
if (action == DeRezAction.TakeCopy)
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
else if (action == DeRezAction.Take)
{
// Override and put into where it came from, if it came
// from anywhere in inventory and the owner is taking it back.
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId)
{
folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID);
if(folder.Type == (int)FolderType.Trash || folder.Type == (int)FolderType.LostAndFound)
if(folder == null || folder.Type == (int)FolderType.Trash || folder.Type == (int)FolderType.LostAndFound)
{
// folder.Type = 6;
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
}
else
{
InventoryFolderBase parent = folder;
while(true)
{
parent = m_Scene.InventoryService.GetFolder(userID, parent.ParentID);
if (parent != null && parent.ParentID == UUID.Zero)
break;
if (parent == null || parent.Type == (int)FolderType.Trash || parent.Type == (int)FolderType.LostAndFound)
{
folder = m_Scene.InventoryService.GetFolderForType(userID, FolderType.Object);
break;
}
}
}
}
}