aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 048cc8b3d68..01e13b29f19 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -307,11 +307,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
{
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat");
- if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- else if (!m_bIsRunning && !me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
- me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
-
+ me->SetWalk(!m_bIsRunning);
RemoveEscortState(STATE_ESCORT_RETURNING);
if (!m_uiWPWaitTimer)
@@ -400,14 +396,14 @@ void npc_escortAI::SetRun(bool on)
if (on)
{
if (!m_bIsRunning)
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->SetWalk(false);
else
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running.");
}
else
{
if (m_bIsRunning)
- me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->SetWalk(true);
else
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking.");
}
@@ -473,9 +469,9 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
//Set initial speed
if (m_bIsRunning)
- me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->SetWalk(false);
else
- me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
+ me->SetWalk(true);
AddEscortState(STATE_ESCORT_ESCORTING);
}