From 62a63f834b7cc056ee37c396034d0e268f66b4a8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 17 Oct 2011 02:04:20 +0100 Subject: refactor: Use SOP.SitTargetAvatar instead of calling a special GetAvatarOnSitTarget() which returned exactly the same thing --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 +++----- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 ++++++----- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 703b986..c25c3b4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1220,6 +1220,9 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// ID of the avatar that is sat on us. If there is no such avatar then is UUID.Zero + /// public UUID SitTargetAvatar { get { return m_sitTargetAvatar; } @@ -1886,11 +1889,6 @@ namespace OpenSim.Region.Framework.Scenes return part; } - public UUID GetAvatarOnSitTarget() - { - return m_sitTargetAvatar; - } - public bool GetDieAtEdge() { if (m_parentGroup.IsDeleted) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index dd1a29d..e0fd84a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1860,11 +1860,12 @@ namespace OpenSim.Region.Framework.Scenes 4); // PERMISSION_TAKE_CONTROLS } } - } + // Reset sit target. - if (part.GetAvatarOnSitTarget() == UUID) + if (part.SitTargetAvatar == UUID) part.SitTargetAvatar = UUID.Zero; + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); ParentPosition = part.GetWorldPosition(); @@ -1913,7 +1914,7 @@ namespace OpenSim.Region.Framework.Scenes // Is a sit target available? Vector3 avSitOffSet = part.SitTargetPosition; Quaternion avSitOrientation = part.SitTargetOrientation; - UUID avOnTargetAlready = part.GetAvatarOnSitTarget(); + UUID avOnTargetAlready = part.SitTargetAvatar; bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetisSet = @@ -1950,7 +1951,7 @@ namespace OpenSim.Region.Framework.Scenes // Is a sit target available? Vector3 avSitOffSet = part.SitTargetPosition; Quaternion avSitOrientation = part.SitTargetOrientation; - UUID avOnTargetAlready = part.GetAvatarOnSitTarget(); + UUID avOnTargetAlready = part.SitTargetAvatar; bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero)); bool SitTargetisSet = @@ -2278,7 +2279,7 @@ namespace OpenSim.Region.Framework.Scenes { if (part != null) { - if (part.GetAvatarOnSitTarget() == UUID) + if (part.SitTargetAvatar == UUID) { Vector3 sitTargetPos = part.SitTargetPosition; Quaternion sitTargetOrient = part.SitTargetOrientation; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 53c9297..54bb62f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6348,7 +6348,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llAvatarOnSitTarget() { m_host.AddScriptLPS(1); - return m_host.GetAvatarOnSitTarget().ToString(); + return m_host.SitTargetAvatar.ToString(); } // http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget -- cgit v1.1