From ae9e4e8144c5f787d71eafe2e0470887f36e3566 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 13 Sep 2008 18:42:09 +0000 Subject: Update avatar-position while avatar is sitting and the prim is moved (#2159). I decided to make ParentPosition a public property in ScenePresence, because that's exactly what happens (the parent position changes on prim move). --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 11 +++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 5 +++++ 2 files changed, 16 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2b0ad12..b4b9f00 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -498,6 +498,17 @@ namespace OpenSim.Region.Environment.Scenes Console.WriteLine(e.Message); } } + + // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too + if(m_sitTargetAvatar != UUID.Zero) { + if (m_parentGroup != null) // TODO can there be a SOP without a SOG? + { + ScenePresence avatar; + if(m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar)) { + avatar.ParentPosition = GetWorldPosition(); + } + } + } } } diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index ff043fb..f58bba6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -287,6 +287,11 @@ namespace OpenSim.Region.Environment.Scenes } protected Vector3 m_parentPosition = new Vector3(); + public Vector3 ParentPosition + { + get { return m_parentPosition; } + set { m_parentPosition = value; } + } /// /// Absolute position of this avatar in 'region cordinates' -- cgit v1.1