diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index b0bac42c90..ff4abc7bc5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -2356,9 +2356,9 @@ namespace OpenSim.Region.Environment.Scenes return att.UUID; } - public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos) + public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent) { - m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, false); + m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); } public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 62e6691607..6634028970 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2042,6 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent) { bool successYN = false; + grp.RootPart.UpdateFlag = 0; int primcrossingXMLmethod = 0; if (newRegionHandle != 0) @@ -2139,7 +2140,7 @@ namespace OpenSim.Region.Environment.Scenes grp.SetFromAssetID(grp.RootPart.LastOwnerID); m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString()); - AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition); + AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); } else { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index a59047baa0..c17e4a7839 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1575,6 +1575,8 @@ namespace OpenSim.Region.Environment.Scenes lock (m_parts) { + bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); + //if (IsAttachment) //{ //foreach (SceneObjectPart part in m_parts.Values) @@ -1584,7 +1586,7 @@ namespace OpenSim.Region.Environment.Scenes //return; //} - if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) + if ((Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) && UsePhysics) { m_rootPart.UpdateFlag = 1; lastPhysGroupPos = AbsolutePosition; @@ -1596,10 +1598,11 @@ namespace OpenSim.Region.Environment.Scenes checkAtTargets(); - if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) + if (((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) + && UsePhysics) { m_rootPart.UpdateFlag = 1; diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index b90dd72079..0efe6e19d0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -646,7 +646,8 @@ namespace OpenSim.Region.Environment.Scenes // We deal with the possibility that two updates occur at // the same unix time at the update point itself. - if (update.LastFullUpdateTime < part.TimeStampFull) + if ((update.LastFullUpdateTime < part.TimeStampFull) || + part.IsAttachment) { // m_log.DebugFormat( // "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}", @@ -693,6 +694,7 @@ namespace OpenSim.Region.Environment.Scenes if (part != part.ParentGroup.RootPart) continue; + System.Threading.Thread.Sleep(1000); part.ParentGroup.SendFullUpdateToClient(ControllingClient); continue; } @@ -3184,7 +3186,7 @@ namespace OpenSim.Region.Environment.Scenes { // Attach from world, if not already attached if (att.ParentGroup != null && !att.IsAttachment) - m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero); + m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero, false); } catch (NullReferenceException) {