diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index dcec7e9681..b3f11a756e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4525,6 +4525,9 @@ namespace OpenSim.Region.Framework.Scenes
///
protected internal bool AddSittingAvatar(UUID avatarId)
{
+ if (IsSitTargetSet && SitTargetAvatar == UUID.Zero)
+ SitTargetAvatar = avatarId;
+
HashSet sittingAvatars = m_sittingAvatars;
if (sittingAvatars == null)
@@ -4547,6 +4550,9 @@ namespace OpenSim.Region.Framework.Scenes
///
protected internal bool RemoveSittingAvatar(UUID avatarId)
{
+ if (SitTargetAvatar == avatarId)
+ SitTargetAvatar = UUID.Zero;
+
HashSet sittingAvatars = m_sittingAvatars;
// This can occur under a race condition where another thread
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a8c98edbdc..514c314ec3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1799,10 +1799,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // Reset sit target.
- if (part.SitTargetAvatar == UUID)
- part.SitTargetAvatar = UUID.Zero;
-
ParentPosition = part.GetWorldPosition();
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
@@ -1884,7 +1880,6 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Sitting {0} on {1} {2} because sit target is set and unoccupied",
// Name, part.Name, part.LocalId);
- part.SitTargetAvatar = UUID;
offset = part.SitTargetPosition;
sitOrientation = part.SitTargetOrientation;
canSit = true;