From b34fd501556cc16a898921a18d29cc85c53fc4ed Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 10 Jul 2012 23:39:05 +0100 Subject: [PATCH] Revert "refactor: Add SOP.IsSitTargetOccupied to improve readability" This reverts commit c8f0d476d2f775ba4d7afca12eeff527b46bb8e2. On reconsideration, I think this is less readable since immediately following code still sets SitTargetAvatar directly --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +------ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6957a4656b..f32350248f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -133,11 +133,6 @@ namespace OpenSim.Region.Framework.Scenes get { return ParentGroup.RootPart == this; } } - /// - /// Is the sit target of this part occupied? - /// - public bool IsSitTargetOccupied { get { return SitTargetAvatar != UUID.Zero; } } - /// /// Is an explicit sit target set for this part? /// @@ -727,7 +722,7 @@ namespace OpenSim.Region.Framework.Scenes } // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too - if (IsSitTargetOccupied) + if (SitTargetAvatar != UUID.Zero) { ScenePresence avatar; if (ParentGroup.Scene.TryGetScenePresence(SitTargetAvatar, out avatar)) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 25c7cae3f1..3885cb4d44 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1911,7 +1911,7 @@ namespace OpenSim.Region.Framework.Scenes //look for prims with explicit sit targets that are available foreach (SceneObjectPart part in partArray) { - if (part.IsSitTargetSet && !part.IsSitTargetOccupied) + if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) { //switch the target to this prim return part; @@ -1943,7 +1943,7 @@ namespace OpenSim.Region.Framework.Scenes if (part.IsSitTargetSet) { - if (!part.IsSitTargetOccupied) + if (part.SitTargetAvatar == UUID.Zero) { // m_log.DebugFormat( // "[SCENE PRESENCE]: Sitting {0} on {1} {2} because sit target is set and unoccupied",