aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2012-02-02 02:51:59 +0100
committerMelanie2012-02-02 02:51:59 +0100
commit6fe4b6fbe807672ec64700ff8c6307a2a3e4f084 (patch)
tree03387054e20ad64ab2513446c4b7736c0975b63a /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-6fe4b6fbe807672ec64700ff8c6307a2a3e4f084.zip
opensim-SC_OLD-6fe4b6fbe807672ec64700ff8c6307a2a3e4f084.tar.gz
opensim-SC_OLD-6fe4b6fbe807672ec64700ff8c6307a2a3e4f084.tar.bz2
opensim-SC_OLD-6fe4b6fbe807672ec64700ff8c6307a2a3e4f084.tar.xz
Fix remembering attachment point and position when an item is rezzed in world.
Also fix PRIM_LOCAL_POS returning 0 when used on child prims from a script in the root.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 7ebf002..fe75271 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -367,6 +367,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
367 367
368 originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; 368 originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition;
369 369
370 // Restore attachment data after trip through the sim
371 if (objectGroup.RootPart.AttachPoint > 0)
372 inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
373 objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
374
370 objectGroup.AbsolutePosition = inventoryStoredPosition; 375 objectGroup.AbsolutePosition = inventoryStoredPosition;
371 376
372 // Make sure all bits but the ones we want are clear 377 // Make sure all bits but the ones we want are clear
@@ -740,6 +745,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
740 if (e == null || attachment) // Single 745 if (e == null || attachment) // Single
741 { 746 {
742 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 747 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
748 if (!attachment)
749 {
750 g.RootPart.AttachPoint = g.RootPart.Shape.State;
751 g.RootPart.AttachOffset = g.AbsolutePosition;
752 }
743 753
744 objlist.Add(g); 754 objlist.Add(g);
745 veclist.Add(new Vector3(0, 0, 0)); 755 veclist.Add(new Vector3(0, 0, 0));
@@ -769,6 +779,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
769 foreach (XmlNode n in groups) 779 foreach (XmlNode n in groups)
770 { 780 {
771 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); 781 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
782 g.RootPart.AttachPoint = g.RootPart.Shape.State;
783 g.RootPart.AttachOffset = g.AbsolutePosition;
772 784
773 objlist.Add(g); 785 objlist.Add(g);
774 XmlElement el = (XmlElement)n; 786 XmlElement el = (XmlElement)n;