From 1cac01b3df83b24e90ef101630316836a79ee792 Mon Sep 17 00:00:00 2001 From: Venugh Date: Thu, 23 Feb 2012 11:50:58 +0100 Subject: Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit. --- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/server/game/AI/ScriptedAI') 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); } -- cgit v1.2.3