move bAllowUpdateMoveToPosition switch outside of HandleMoveToTargetUpdate()
parent
831f933ce6
commit
61a931490d
|
@ -1492,10 +1492,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ResetMoveToTarget();
|
ResetMoveToTarget();
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
}
|
}
|
||||||
else
|
else if (bAllowUpdateMoveToPosition)
|
||||||
{
|
{
|
||||||
if (HandleMoveToTargetUpdate(
|
if (HandleMoveToTargetUpdate(ref agent_control_v3, bodyRotation))
|
||||||
ref agent_control_v3, bodyRotation, bAllowUpdateMoveToPosition))
|
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1557,10 +1556,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
|
/// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
|
||||||
/// <param value="bodyRotation">New body rotation of the avatar.</param>
|
/// <param value="bodyRotation">New body rotation of the avatar.</param>
|
||||||
/// <param value="allowUpdate">If true, allow the update in principle.</param>
|
|
||||||
/// <returns>True if movement has been updated in some way. False otherwise.</returns>
|
/// <returns>True if movement has been updated in some way. False otherwise.</returns>
|
||||||
public bool HandleMoveToTargetUpdate(
|
public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3, Quaternion bodyRotation)
|
||||||
ref Vector3 agent_control_v3, Quaternion bodyRotation, bool allowUpdate)
|
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
|
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
|
||||||
|
|
||||||
|
@ -1570,7 +1567,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// "[SCENE PRESENCE]: bAllowUpdateMoveToPosition {0}, m_moveToPositionInProgress {1}, m_autopilotMoving {2}",
|
// "[SCENE PRESENCE]: bAllowUpdateMoveToPosition {0}, m_moveToPositionInProgress {1}, m_autopilotMoving {2}",
|
||||||
// allowUpdate, m_moveToPositionInProgress, m_autopilotMoving);
|
// allowUpdate, m_moveToPositionInProgress, m_autopilotMoving);
|
||||||
|
|
||||||
if (allowUpdate && (m_moveToPositionInProgress && !m_autopilotMoving))
|
if (!m_autopilotMoving)
|
||||||
{
|
{
|
||||||
double distanceToTarget = Util.GetDistanceTo(AbsolutePosition, MoveToPositionTarget);
|
double distanceToTarget = Util.GetDistanceTo(AbsolutePosition, MoveToPositionTarget);
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
|
@ -1711,7 +1708,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
MoveToPositionTarget = pos;
|
MoveToPositionTarget = pos;
|
||||||
|
|
||||||
Vector3 agent_control_v3 = new Vector3();
|
Vector3 agent_control_v3 = new Vector3();
|
||||||
HandleMoveToTargetUpdate(ref agent_control_v3, Rotation, true);
|
HandleMoveToTargetUpdate(ref agent_control_v3, Rotation);
|
||||||
AddNewMovement(agent_control_v3, Rotation);
|
AddNewMovement(agent_control_v3, Rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Vector3 agent_control_v3 = new Vector3();
|
Vector3 agent_control_v3 = new Vector3();
|
||||||
presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation, true);
|
presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation);
|
||||||
presence.AddNewMovement(agent_control_v3, presence.Rotation);
|
presence.AddNewMovement(agent_control_v3, presence.Rotation);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue