From 25677e4a1b12c113062a3d6fc8ea4558ddc319ec Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 21 Sep 2015 21:31:01 +0100 Subject: try to remove Scenepresence dependence on sog m_linkedAvatars, sitting may still work --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 ++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 ++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index d1a6692..abac3c0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5555,7 +5555,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter if (m_sittingAvatars.Add(sp)) { - ParentGroup.m_sittingAvatars.Add(sp); + if(!ParentGroup.m_sittingAvatars.Contains(sp)) + ParentGroup.m_sittingAvatars.Add(sp); return true; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 974dd62..df1352d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1138,7 +1138,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - part.ParentGroup.AddAvatar(UUID); + part.AddSittingAvatar(this); if (part.SitTargetPosition != Vector3.Zero) part.SitTargetAvatar = UUID; ParentID = part.LocalId; @@ -2838,7 +2838,7 @@ namespace OpenSim.Region.Framework.Scenes } } - part.ParentGroup.DeleteAvatar(UUID); +// part.ParentGroup.DeleteAvatar(UUID); Quaternion standRotation = part.ParentGroup.RootPart.RotationOffset; Vector3 sitPartWorldPosition = part.ParentGroup.AbsolutePosition + m_pos * standRotation; @@ -3132,8 +3132,6 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; m_AngularVelocity = Vector3.Zero; - part.AddSittingAvatar(this); - Vector3 cameraAtOffset = part.GetCameraAtOffset(); Vector3 cameraEyeOffset = part.GetCameraEyeOffset(); bool forceMouselook = part.GetForceMouselook(); @@ -3158,7 +3156,6 @@ namespace OpenSim.Region.Framework.Scenes cameraEyeOffset = cameraEyeOffset * part.RotationOffset; cameraEyeOffset += part.OffsetPosition; } - } m_pos = offset; @@ -3168,19 +3165,13 @@ namespace OpenSim.Region.Framework.Scenes m_requestedSitTargetID = 0; - part.ParentGroup.AddAvatar(UUID); + part.AddSittingAvatar(this); ParentPart = part; ParentID = part.LocalId; SendAvatarDataToAllAgents(); -/* - if(status == 3) - Animator.TrySetMovementAnimation("SIT_GROUND"); - else - Animator.TrySetMovementAnimation("SIT"); -*/ if (status == 3) sitAnimation = "SIT_GROUND"; else @@ -3275,7 +3266,7 @@ namespace OpenSim.Region.Framework.Scenes // Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId); } - part.ParentGroup.AddAvatar(UUID); + part.AddSittingAvatar(this); ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID); ParentID = m_requestedSitTargetID; m_AngularVelocity = Vector3.Zero; -- cgit v1.1