From 15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Aug 2011 23:06:41 +0100 Subject: refactor: simplify SOP.AttachedAvatar into SOG.AttachedAvatar This does a tiny bit to reduce code complexity, memory requirement and the cpu time of pointlessly setting this field to the same value in every SOP --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e3b8fc8..fada688 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -169,6 +169,14 @@ namespace OpenSim.Region.Framework.Scenes } /// + /// The avatar to which this scene object is attached. + /// + /// + /// If we're not attached to an avatar then this is UUID.Zero + /// + public UUID AttachedAvatar { get; set; } + + /// /// Is this scene object phantom? /// /// @@ -1540,7 +1548,7 @@ namespace OpenSim.Region.Framework.Scenes { if (IsAttachment) { - ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); if (avatar != null) { avatar.PushForce(impulse); @@ -1622,7 +1630,7 @@ namespace OpenSim.Region.Framework.Scenes { if (IsAttachment) { - ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); + ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); if (avatar != null) { avatar.MoveToTarget(target, false); -- cgit v1.1