aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-04-30 17:54:00 +0100
committerJustin Clark-Casey (justincc)2010-04-30 17:54:00 +0100
commit89e79c11335d55ae8131d6fa92218bf387e6c48e (patch)
treebb96e1093123b21e41f52e61000398f82f83f23b /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
parentrename SQLiteNG to SQLite and SQLite to SQLiteLegacy (diff)
parentFix some symbol errors (diff)
downloadopensim-SC_OLD-89e79c11335d55ae8131d6fa92218bf387e6c48e.zip
opensim-SC_OLD-89e79c11335d55ae8131d6fa92218bf387e6c48e.tar.gz
opensim-SC_OLD-89e79c11335d55ae8131d6fa92218bf387e6c48e.tar.bz2
opensim-SC_OLD-89e79c11335d55ae8131d6fa92218bf387e6c48e.tar.xz
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs65
1 files changed, 36 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 3b1b567..4da63c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -609,43 +609,50 @@ namespace OpenSim.Region.Framework.Scenes
609 /// <returns>false if the item did not exist, true if the update occurred successfully</returns> 609 /// <returns>false if the item did not exist, true if the update occurred successfully</returns>
610 public bool UpdateInventoryItem(TaskInventoryItem item) 610 public bool UpdateInventoryItem(TaskInventoryItem item)
611 { 611 {
612 lock (m_items) 612 return UpdateInventoryItem(item, true);
613 }
614
615 public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
616 {
617 lock(m_items)
613 { 618 {
614 if (m_items.ContainsKey(item.ItemID)) 619 if (m_items.ContainsKey(item.ItemID))
615 { 620 {
616 item.ParentID = m_part.UUID; 621 if (m_items.ContainsKey(item.ItemID))
617 item.ParentPartID = m_part.UUID;
618 item.Flags = m_items[item.ItemID].Flags;
619
620 // If group permissions have been set on, check that the groupID is up to date in case it has
621 // changed since permissions were last set.
622 if (item.GroupPermissions != (uint)PermissionMask.None)
623 item.GroupID = m_part.GroupID;
624
625 if (item.AssetID == UUID.Zero)
626 { 622 {
627 item.AssetID = m_items[item.ItemID].AssetID; 623 item.ParentID = m_part.UUID;
624 item.ParentPartID = m_part.UUID;
625 item.Flags = m_items[item.ItemID].Flags;
626
627 // If group permissions have been set on, check that the groupID is up to date in case it has
628 // changed since permissions were last set.
629 if (item.GroupPermissions != (uint)PermissionMask.None)
630 item.GroupID = m_part.GroupID;
631
632 if (item.AssetID == UUID.Zero)
633 {
634 item.AssetID = m_items[item.ItemID].AssetID;
635 }
636 m_items[item.ItemID] = item;
637 m_inventorySerial++;
638 if (fireScriptEvents)
639 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
640 HasInventoryChanged = true;
641 m_part.ParentGroup.HasGroupChanged = true;
642 return true;
643 }
644 else
645 {
646 m_log.ErrorFormat(
647 "[PRIM INVENTORY]: " +
648 "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
649 item.ItemID, m_part.Name, m_part.UUID,
650 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
628 } 651 }
629 652
630 m_items[item.ItemID] = item;
631 m_inventorySerial++;
632 m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
633 HasInventoryChanged = true;
634 m_part.ParentGroup.HasGroupChanged = true;
635
636 return true;
637 }
638 else
639 {
640 m_log.ErrorFormat(
641 "[PRIM INVENTORY]: " +
642 "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
643 item.ItemID, m_part.Name, m_part.UUID,
644 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
645 } 653 }
654 return false;
646 } 655 }
647
648 return false;
649 } 656 }
650 657
651 /// <summary> 658 /// <summary>