aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs51
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
2 files changed, 29 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index e94d059..f8515b4 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -719,26 +719,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
719 } 719 }
720 720
721 SceneObjectGroup group = null; 721 SceneObjectGroup group = null;
722 UUID itemId = UUID.Zero;
723
724 // If we have permission to copy then link the rezzed object back to the user inventory
725 // item that it came from. This allows us to enable 'save object to inventory'
726 if (!m_Scene.Permissions.BypassPermissions())
727 {
728 if ((item.CurrentPermissions & (uint)PermissionMask.Copy)
729 == (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
730 {
731 itemId = item.ID;
732 }
733 }
734 else
735 {
736 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
737 {
738 // Brave new fullperm world
739 itemId = item.ID;
740 }
741 }
742 722
743 string xmlData = Utils.BytesToString(rezAsset.Data); 723 string xmlData = Utils.BytesToString(rezAsset.Data);
744 List<SceneObjectGroup> objlist = 724 List<SceneObjectGroup> objlist =
@@ -753,8 +733,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
753 if (e == null || attachment) // Single 733 if (e == null || attachment) // Single
754 { 734 {
755 SceneObjectGroup g = 735 SceneObjectGroup g =
756 SceneObjectSerializer.FromOriginalXmlFormat( 736 SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, xmlData);
757 itemId, xmlData); 737
758 objlist.Add(g); 738 objlist.Add(g);
759 veclist.Add(new Vector3(0, 0, 0)); 739 veclist.Add(new Vector3(0, 0, 0));
760 740
@@ -783,8 +763,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
783 foreach (XmlNode n in groups) 763 foreach (XmlNode n in groups)
784 { 764 {
785 SceneObjectGroup g = 765 SceneObjectGroup g =
786 SceneObjectSerializer.FromOriginalXmlFormat( 766 SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, n.OuterXml);
787 itemId, n.OuterXml); 767
788 objlist.Add(g); 768 objlist.Add(g);
789 XmlElement el = (XmlElement)n; 769 XmlElement el = (XmlElement)n;
790 770
@@ -893,6 +873,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
893 private bool DoPreRezWhenFromItem( 873 private bool DoPreRezWhenFromItem(
894 IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, Vector3 pos, bool isAttachment) 874 IClientAPI remoteClient, InventoryItemBase item, List<SceneObjectGroup> objlist, Vector3 pos, bool isAttachment)
895 { 875 {
876 UUID fromUserInventoryItemId = UUID.Zero;
877
878 // If we have permission to copy then link the rezzed object back to the user inventory
879 // item that it came from. This allows us to enable 'save object to inventory'
880 if (!m_Scene.Permissions.BypassPermissions())
881 {
882 if ((item.CurrentPermissions & (uint)PermissionMask.Copy)
883 == (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
884 {
885 fromUserInventoryItemId = item.ID;
886 }
887 }
888 else
889 {
890 if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
891 {
892 // Brave new fullperm world
893 fromUserInventoryItemId = item.ID;
894 }
895 }
896
896 int primcount = 0; 897 int primcount = 0;
897 foreach (SceneObjectGroup g in objlist) 898 foreach (SceneObjectGroup g in objlist)
898 primcount += g.PrimCount; 899 primcount += g.PrimCount;
@@ -958,6 +959,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
958 959
959 foreach (SceneObjectPart part in so.Parts) 960 foreach (SceneObjectPart part in so.Parts)
960 { 961 {
962 part.FromUserInventoryItemID = fromUserInventoryItemId;
963
961 if ((part.OwnerID != item.Owner) || 964 if ((part.OwnerID != item.Owner) ||
962 (item.CurrentPermissions & 16) != 0) 965 (item.CurrentPermissions & 16) != 0)
963 { 966 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index a8f2ebd..9d573db 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -208,13 +208,12 @@ namespace OpenSim.Region.Framework.Scenes
208 /// </value> 208 /// </value>
209 private UUID m_fromUserInventoryItemID; 209 private UUID m_fromUserInventoryItemID;
210 210
211
212 public UUID FromUserInventoryItemID 211 public UUID FromUserInventoryItemID
213 { 212 {
214 get { return m_fromUserInventoryItemID; } 213 get { return m_fromUserInventoryItemID; }
214 set { m_fromUserInventoryItemID = value; }
215 } 215 }
216 216
217
218 public scriptEvents AggregateScriptEvents; 217 public scriptEvents AggregateScriptEvents;
219 218
220 219