aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/InventoryAccess
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-03 01:11:16 +0100
committerJustin Clark-Casey (justincc)2011-09-03 01:11:16 +0100
commit5c1fa968ab954bec9860023dffc8f68baf3c0620 (patch)
treef5be7264076e9e2815cd05f6a7ba8bac2831330a /OpenSim/Region/CoreModules/Framework/InventoryAccess
parentComment out Scene.CleanDroppedAttachments() and calls. (diff)
downloadopensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.zip
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.gz
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.bz2
opensim-SC_OLD-5c1fa968ab954bec9860023dffc8f68baf3c0620.tar.xz
Stop NPCs losing attachments when the source avatar takes them off.
This was happening because we were using the source avatar's item IDs in the clone appearance. Switch to using the asset IDs of attachments instead for NPCs. The InventoryAccessModule and AttachmentModule had to be changed to allow rezzing of an object without an associated inventory item. Hopefully goes some way towards resolving http://opensimulator.org/mantis/view.php?id=5653
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs67
1 files changed, 35 insertions, 32 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 0c0b0c5..4e8466d 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -669,28 +669,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
669 return item; 669 return item;
670 } 670 }
671 671
672 /// <summary> 672 public virtual SceneObjectGroup RezObject(
673 /// Rez an object into the scene from the user's inventory 673 IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
674 /// </summary> 674 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
675 /// <remarks> 675 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
676 /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing
677 /// things to the scene. The caller should be doing that, I think.
678 /// </remarks>
679 /// <param name="remoteClient"></param>
680 /// <param name="itemID"></param>
681 /// <param name="RayEnd"></param>
682 /// <param name="RayStart"></param>
683 /// <param name="RayTargetID"></param>
684 /// <param name="BypassRayCast"></param>
685 /// <param name="RayEndIsIntersection"></param>
686 /// <param name="RezSelected"></param>
687 /// <param name="RemoveItem"></param>
688 /// <param name="fromTaskID"></param>
689 /// <param name="attachment"></param>
690 /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful.</returns>
691 public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
692 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
693 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
694 { 676 {
695// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); 677// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
696 678
@@ -707,13 +689,34 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
707 } 689 }
708 690
709 item.Owner = remoteClient.AgentId; 691 item.Owner = remoteClient.AgentId;
710 AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); 692
693 return RezObject(
694 remoteClient, item, item.AssetID,
695 RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
696 RezSelected, RemoveItem, fromTaskID, attachment);
697 }
698
699 public virtual SceneObjectGroup RezObject(
700 IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart,
701 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
702 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
703 {
704 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
711 705
712 if (rezAsset == null) 706 if (rezAsset == null)
713 { 707 {
714 m_log.WarnFormat( 708 if (item != null)
715 "[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()", 709 {
716 item.AssetID, item.Name, item.ID, remoteClient.Name); 710 m_log.WarnFormat(
711 "[InventoryAccessModule]: Could not find asset {0} for item {1} {2} for {3} in RezObject()",
712 assetID, item.Name, item.ID, remoteClient.Name);
713 }
714 else
715 {
716 m_log.WarnFormat(
717 "[InventoryAccessModule]: Could not find asset {0} for {1} in RezObject()",
718 assetID, remoteClient.Name);
719 }
717 720
718 return null; 721 return null;
719 } 722 }
@@ -781,7 +784,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
781 } 784 }
782 } 785 }
783 786
784 if (!DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment)) 787 if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment))
785 return null; 788 return null;
786 789
787 for (int i = 0; i < objlist.Count; i++) 790 for (int i = 0; i < objlist.Count; i++)
@@ -829,10 +832,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
829 832
830 group.AbsolutePosition = pos + veclist[i]; 833 group.AbsolutePosition = pos + veclist[i];
831 } 834 }
832 else
833 {
834 group.SetFromItemID(itemID);
835 }
836 835
837 SceneObjectPart rootPart = group.RootPart; 836 SceneObjectPart rootPart = group.RootPart;
838 837
@@ -855,7 +854,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
855// group.Name, group.LocalId, group.UUID, remoteClient.Name); 854// group.Name, group.LocalId, group.UUID, remoteClient.Name);
856 } 855 }
857 856
858 DoPostRezWhenFromItem(item, attachment); 857 if (item != null)
858 DoPostRezWhenFromItem(item, attachment);
859 859
860 return group; 860 return group;
861 } 861 }
@@ -973,6 +973,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
973 } 973 }
974 974
975 rootPart.TrimPermissions(); 975 rootPart.TrimPermissions();
976
977 if (isAttachment)
978 so.SetFromItemID(item.ID);
976 } 979 }
977 980
978 return true; 981 return true;