From 2bd7bbd1cb3e962ec10af0fb009a8296587d4cd6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Sep 2015 02:25:12 +0100 Subject: restore some avn code, fixing for var regions --- .../InventoryAccess/InventoryAccessModule.cs | 31 ++++++---------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 96f1198..e5373c3 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -399,13 +399,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess DeRezAction action, UUID folderID, List objlist, IClientAPI remoteClient, bool asAttachment) { - CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); + CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); Dictionary originalPositions = new Dictionary(); + Dictionary originalRotations = new Dictionary(); // this possible is not needed if keyframes are saved Dictionary originalKeyframes = new Dictionary(); - - Dictionary group2Keyframe = new Dictionary(); - + foreach (SceneObjectGroup objectGroup in objlist) { if (objectGroup.RootPart.KeyframeMotion != null) @@ -418,18 +417,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess originalKeyframes[objectGroup.UUID] = objectGroup.RootPart.KeyframeMotion; objectGroup.RootPart.KeyframeMotion = null; - Vector3 inventoryStoredPosition = new Vector3 - (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : objectGroup.AbsolutePosition.X) - , - (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize) - ? 250 - : objectGroup.AbsolutePosition.Y, - objectGroup.AbsolutePosition.Z); - + Vector3 inventoryStoredPosition = objectGroup.AbsolutePosition; + originalPositions[objectGroup.UUID] = inventoryStoredPosition; Quaternion inventoryStoredRotation = objectGroup.GroupRotation; - originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; + originalRotations[objectGroup.UUID] = inventoryStoredRotation; // Restore attachment data after trip through the sim if (objectGroup.RootPart.AttachPoint > 0) @@ -481,6 +472,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess foreach (SceneObjectGroup objectGroup in objlist) { objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; + objectGroup.RootPart.RotationOffset = originalRotations[objectGroup.UUID]; objectGroup.RootPart.KeyframeMotion = originalKeyframes[objectGroup.UUID]; if (objectGroup.RootPart.KeyframeMotion != null) objectGroup.RootPart.KeyframeMotion.Resume(); @@ -563,13 +555,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - // Restore KeyframeMotion - foreach (SceneObjectGroup objectGroup in group2Keyframe.Keys) - { - objectGroup.RootPart.KeyframeMotion = group2Keyframe[objectGroup]; - objectGroup.RootPart.KeyframeMotion.Start(); - } - // This is a hook to do some per-asset post-processing for subclasses that need that if (remoteClient != null) ExportAsset(remoteClient.AgentId, asset.FullID); @@ -993,7 +978,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // one full update during the attachment // process causes some clients to fail to display the // attachment properly. - m_Scene.AddNewSceneObject(group, !attachment, false); + m_Scene.AddNewSceneObject(group, true, false); // if attachment we set it's asset id so object updates // can reflect that, if not, we set it's position in world. -- cgit v1.1