diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b43d01ddb9..705a996d00 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -436,8 +436,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
- // Reset animations; the viewer does that in teleports.
- sp.Animator.ResetAnimations();
destinationRegionName = sp.Scene.RegionInfo.RegionName;
TeleportAgentWithinRegion(sp, position, lookAt, teleportFlags);
@@ -787,7 +785,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions
- if (sp.ParentID != (uint)0)
+ if (sp.IsSitting)
sp.StandUp();
else if (sp.Flying)
teleportFlags |= (uint)TeleportFlags.IsFlying;
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index a5e3af1369..a11502e587 100755
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -452,7 +452,7 @@ namespace OpenSim.Region.CoreModules.World.Land
avatar.AbsolutePosition = position.Value;
avatar.lastKnownAllowedPosition = position.Value;
avatar.Velocity = Vector3.Zero;
- if(avatar.IsSatOnObject)
+ if(avatar.IsSitting)
avatar.StandUp();
forcedPosition.Add(avatar.UUID);
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e1eb1abfe5..c6f43e97ab 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -935,7 +935,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// A more readable way of testing presence sit status than ParentID == 0
public bool IsSatOnObject { get { return ParentID != 0; } }
-
+ public bool IsSitting { get {return SitGround || IsSatOnObject; }}
///
/// If the avatar is sitting, the prim that it's sitting on. If not sitting then null.
///
@@ -1770,8 +1770,8 @@ namespace OpenSim.Region.Framework.Scenes
if(!CheckLocalTPLandingPoint(ref pos))
return;
- if (ParentID != (uint)0)
- StandUp();
+ if (IsSitting)
+ StandUp(false);
bool isFlying = Flying;
Vector3 vel = Velocity;
@@ -1792,8 +1792,8 @@ namespace OpenSim.Region.Framework.Scenes
public void TeleportOnEject(Vector3 pos)
{
- if (ParentID != (uint)0)
- StandUp();
+ if (IsSitting )
+ StandUp(false);
bool isFlying = Flying;
RemoveFromPhysicalScene();
@@ -1835,7 +1835,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!m_scene.TestLandRestrictions(UUID, out string reason, ref newpos.X, ref newpos.Y))
return ;
- if (IsSatOnObject)
+ if (IsSitting)
StandUp();
if(m_movingToTarget)
@@ -3197,7 +3197,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_delayedStop = -1;
- if (SitGround || IsSatOnObject)
+ if (IsSitting)
StandUp();
// m_log.DebugFormat(
@@ -3297,7 +3297,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Perform the logic necessary to stand the avatar up. This method also executes
/// the stand animation.
///
- public void StandUp()
+ public void StandUp(bool addPhys = true)
{
// m_log.DebugFormat("[SCENE PRESENCE]: StandUp() for {0}", Name);
@@ -3386,7 +3386,7 @@ namespace OpenSim.Region.Framework.Scenes
m_pos = sitWorldPosition + adjustmentForSitPose;
}
- if (PhysicsActor == null)
+ if (addPhys && PhysicsActor == null)
AddToPhysicalScene(false);
if (satOnObject)
@@ -3394,7 +3394,7 @@ namespace OpenSim.Region.Framework.Scenes
m_requestedSitTargetID = 0;
part.RemoveSittingAvatar(this);
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
-
+
SendAvatarDataToAllAgents();
m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on
}
@@ -3544,6 +3544,8 @@ namespace OpenSim.Region.Framework.Scenes
StandUp();
}
+ else if(SitGround)
+ StandUp();
SceneObjectPart part = FindNextAvailableSitTarget(targetID);
@@ -3687,7 +3689,7 @@ namespace OpenSim.Region.Framework.Scenes
if (IsChildAgent)
return;
- if(SitGround || IsSatOnObject)
+ if(IsSitting)
return;
SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);