diff options
author | Justin Clark-Casey (justincc) | 2011-08-04 01:16:24 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-04 01:16:24 +0100 |
commit | 7b2b47530e48153b53c00cd33356abbbdb13d0b5 (patch) | |
tree | 2d16beaf1c8987c3b39af8135022e28c71e09a77 /OpenSim/Region | |
parent | Make SIGNIFICANT_MOVEMENT SP constant a top-level property so that other clas... (diff) | |
download | opensim-SC_OLD-7b2b47530e48153b53c00cd33356abbbdb13d0b5.zip opensim-SC_OLD-7b2b47530e48153b53c00cd33356abbbdb13d0b5.tar.gz opensim-SC_OLD-7b2b47530e48153b53c00cd33356abbbdb13d0b5.tar.bz2 opensim-SC_OLD-7b2b47530e48153b53c00cd33356abbbdb13d0b5.tar.xz |
move reset code out of HandleMoveToTargetUpdate() so that we only call it where needed instead of passing in a flag
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 |
2 files changed, 13 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b7fa3b6..d471414 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1485,9 +1485,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | // If the user has pressed a key then we want to cancel any move to target. | 1487 | // If the user has pressed a key then we want to cancel any move to target. |
1488 | if (HandleMoveToTargetUpdate( | 1488 | if (DCFlagKeyPressed && m_moveToPositionInProgress) |
1489 | ref agent_control_v3, bodyRotation, DCFlagKeyPressed, bAllowUpdateMoveToPosition)) | 1489 | { |
1490 | ResetMoveToTarget(); | ||
1490 | update_movementflag = true; | 1491 | update_movementflag = true; |
1492 | } | ||
1493 | else | ||
1494 | { | ||
1495 | if (HandleMoveToTargetUpdate( | ||
1496 | ref agent_control_v3, bodyRotation, bAllowUpdateMoveToPosition)) | ||
1497 | update_movementflag = true; | ||
1498 | } | ||
1491 | } | 1499 | } |
1492 | 1500 | ||
1493 | // Cause the avatar to stop flying if it's colliding | 1501 | // Cause the avatar to stop flying if it's colliding |
@@ -1546,27 +1554,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1546 | /// </remarks> | 1554 | /// </remarks> |
1547 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> | 1555 | /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> |
1548 | /// <param value="bodyRotation">New body rotation of the avatar.</param> | 1556 | /// <param value="bodyRotation">New body rotation of the avatar.</param> |
1549 | /// <param value="reset">If true, clear the move to position</param> | ||
1550 | /// <param value="allowUpdate">If true, allow the update in principle.</param> | 1557 | /// <param value="allowUpdate">If true, allow the update in principle.</param> |
1551 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> | 1558 | /// <returns>True if movement has been updated in some way. False otherwise.</returns> |
1552 | public bool HandleMoveToTargetUpdate( | 1559 | public bool HandleMoveToTargetUpdate( |
1553 | ref Vector3 agent_control_v3, Quaternion bodyRotation, bool reset, bool allowUpdate) | 1560 | ref Vector3 agent_control_v3, Quaternion bodyRotation, bool allowUpdate) |
1554 | { | 1561 | { |
1555 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); | 1562 | // m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); |
1556 | 1563 | ||
1557 | bool updated = false; | 1564 | bool updated = false; |
1558 | 1565 | ||
1559 | if (reset) | ||
1560 | { | ||
1561 | if (m_moveToPositionInProgress) | ||
1562 | { | ||
1563 | ResetMoveToTarget(); | ||
1564 | updated = true; | ||
1565 | } | ||
1566 | |||
1567 | return updated; | ||
1568 | } | ||
1569 | |||
1570 | // m_log.DebugFormat( | 1566 | // m_log.DebugFormat( |
1571 | // "[SCENE PRESENCE]: bAllowUpdateMoveToPosition {0}, m_moveToPositionInProgress {1}, m_autopilotMoving {2}", | 1567 | // "[SCENE PRESENCE]: bAllowUpdateMoveToPosition {0}, m_moveToPositionInProgress {1}, m_autopilotMoving {2}", |
1572 | // allowUpdate, m_moveToPositionInProgress, m_autopilotMoving); | 1568 | // allowUpdate, m_moveToPositionInProgress, m_autopilotMoving); |
@@ -1712,7 +1708,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1712 | MoveToPositionTarget = pos; | 1708 | MoveToPositionTarget = pos; |
1713 | 1709 | ||
1714 | Vector3 agent_control_v3 = new Vector3(); | 1710 | Vector3 agent_control_v3 = new Vector3(); |
1715 | HandleMoveToTargetUpdate(ref agent_control_v3, Rotation, false, true); | 1711 | HandleMoveToTargetUpdate(ref agent_control_v3, Rotation, true); |
1716 | AddNewMovement(agent_control_v3, Rotation); | 1712 | AddNewMovement(agent_control_v3, Rotation); |
1717 | } | 1713 | } |
1718 | 1714 | ||
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index a0a24f2..fa60653 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
87 | else | 87 | else |
88 | { | 88 | { |
89 | Vector3 agent_control_v3 = new Vector3(); | 89 | Vector3 agent_control_v3 = new Vector3(); |
90 | presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation, false, true); | 90 | presence.HandleMoveToTargetUpdate(ref agent_control_v3, presence.Rotation, true); |
91 | presence.AddNewMovement(agent_control_v3, presence.Rotation); | 91 | presence.AddNewMovement(agent_control_v3, presence.Rotation); |
92 | } | 92 | } |
93 | // | 93 | // |