From 1c126e6e222989dc9ce66e65380d120c7ee8d24d Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 3 Aug 2011 00:55:52 +0100 Subject: [PATCH] refactor: Move update_movement_flag and the final check inside the m_allowMovement if in HandleAgentUpdate() since it's logically only ever used there --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 06b27ca539..7cc6d66964 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1377,11 +1377,11 @@ namespace OpenSim.Region.Framework.Scenes { return; } - - bool update_movementflag = false; if (m_allowMovement && !SitGround) { + bool update_movementflag = false; + if (agentData.UseClientAgentPosition) { m_moveToPositionInProgress = (agentData.ClientAgentPosition - AbsolutePosition).Length() > 0.2f; @@ -1521,10 +1521,10 @@ namespace OpenSim.Region.Framework.Scenes AddNewMovement(agent_control_v3, q); } - } - if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround) - Animator.UpdateMovementAnimations(); + if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround) + Animator.UpdateMovementAnimations(); + } m_scene.EventManager.TriggerOnClientMovement(this);