diff options
author | Charles Krinke | 2008-05-19 20:05:10 +0000 |
---|---|---|
committer | Charles Krinke | 2008-05-19 20:05:10 +0000 |
commit | 01b5425a2dc4e7675db9fceebc693479b37890ca (patch) | |
tree | ea94ace681983d9147f6fb5ce5cf3e2c459b06e3 /OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |
parent | i can haz pantz? (diff) | |
download | opensim-SC_OLD-01b5425a2dc4e7675db9fceebc693479b37890ca.zip opensim-SC_OLD-01b5425a2dc4e7675db9fceebc693479b37890ca.tar.gz opensim-SC_OLD-01b5425a2dc4e7675db9fceebc693479b37890ca.tar.bz2 opensim-SC_OLD-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.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 24 |
1 files changed, 24 insertions, 0 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> |