From a3052e40ad9ae56d5e968af9792e0ff8b905e9b9 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 11 Nov 2011 23:28:32 +0000
Subject: extract ground sit code into SP.HandleAgentSitOnGround() for
consistency with other sitting code.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 31 +++++++++++++++---------
1 file changed, 19 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f5a7f02..3fee642 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -163,7 +163,11 @@ namespace OpenSim.Region.Framework.Scenes
private uint m_requestedSitTargetID;
private UUID m_requestedSitTargetUUID;
- public bool SitGround = false;
+
+ ///
+ /// Are we sitting on the ground?
+ ///
+ public bool SitGround { get; private set; }
private SendCourseLocationsMethod m_sendCourseLocationsMethod;
@@ -1410,17 +1414,7 @@ namespace OpenSim.Region.Framework.Scenes
}
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0)
- {
- m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.
- Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
-
- // TODO: This doesn't prevent the user from walking yet.
- // Setting parent ID would fix this, if we knew what value
- // to use. Or we could add a m_isSitting variable.
- //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
- SitGround = true;
- RemoveFromPhysicalScene();
- }
+ HandleAgentSitOnGround();
// In the future, these values might need to go global.
// Here's where you get them.
@@ -2314,6 +2308,19 @@ namespace OpenSim.Region.Framework.Scenes
SendAvatarDataToAllAgents();
}
+ public void HandleAgentSitOnGround()
+ {
+ m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.
+ Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
+
+ // TODO: This doesn't prevent the user from walking yet.
+ // Setting parent ID would fix this, if we knew what value
+ // to use. Or we could add a m_isSitting variable.
+ //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
+ SitGround = true;
+ RemoveFromPhysicalScene();
+ }
+
///
/// Event handler for the 'Always run' setting on the client
/// Tells the physics plugin to increase speed of movement.
--
cgit v1.1