aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2008-05-19 20:05:10 +0000
committerCharles Krinke2008-05-19 20:05:10 +0000
commit01b5425a2dc4e7675db9fceebc693479b37890ca (patch)
treeea94ace681983d9147f6fb5ce5cf3e2c459b06e3
parenti can haz pantz? (diff)
downloadopensim-SC-01b5425a2dc4e7675db9fceebc693479b37890ca.zip
opensim-SC-01b5425a2dc4e7675db9fceebc693479b37890ca.tar.gz
opensim-SC-01b5425a2dc4e7675db9fceebc693479b37890ca.tar.bz2
opensim-SC-01b5425a2dc4e7675db9fceebc693479b37890ca.tar.xz
Thank you kindly, Melanie for a patch that avoids a null
ref in inventory give and also now causes items to appear in the correct folders now, no longer in the root folder.
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs24
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs2
2 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index f40f078..1cbffc7 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -485,6 +485,14 @@ namespace OpenSim.Framework.Communications.Cache
485 { 485 {
486 if (HasInventory) 486 if (HasInventory)
487 { 487 {
488 if(item.Folder == LLUUID.Zero)
489 {
490 InventoryFolderImpl f=FindFolderForType(item.AssetType);
491 if(f != null)
492 item.Folder=f.ID;
493 else
494 item.Folder=RootFolder.ID;
495 }
488 ItemReceive(item); 496 ItemReceive(item);
489 m_commsManager.InventoryService.AddItem(item); 497 m_commsManager.InventoryService.AddItem(item);
490 } 498 }
@@ -606,6 +614,22 @@ namespace OpenSim.Framework.Communications.Cache
606 return true; 614 return true;
607 } 615 }
608 } 616 }
617
618 private InventoryFolderImpl FindFolderForType(int type)
619 {
620 if(RootFolder == null)
621 return null;
622
623 lock(RootFolder.SubFolders)
624 {
625 foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values)
626 {
627 if(f.Type == type)
628 return f;
629 }
630 }
631 return null;
632 }
609 } 633 }
610 634
611 /// <summary> 635 /// <summary>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0ab8779..53ae28f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -371,7 +371,7 @@ namespace OpenSim.Region.Environment.Scenes
371 itemCopy.Name = item.Name; 371 itemCopy.Name = item.Name;
372 itemCopy.AssetType = item.AssetType; 372 itemCopy.AssetType = item.AssetType;
373 itemCopy.InvType = item.InvType; 373 itemCopy.InvType = item.InvType;
374 itemCopy.Folder = recipientUserInfo.RootFolder.ID; 374 itemCopy.Folder = LLUUID.Zero;
375 if (ExternalChecks.ExternalChecksPropagatePermissions()) 375 if (ExternalChecks.ExternalChecksPropagatePermissions())
376 { 376 {
377 if (item.InvType == 6) 377 if (item.InvType == 6)