From 3f4bf697b8eb6239748ca728ec17a67322f7924d Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sat, 28 Nov 2009 15:19:31 +0100 Subject: Shuld fix quest The Light of Dawn ( #85 ), and some escort that use STATE_ESCORT_PAUSED --HG-- branch : trunk --- src/bindings/scripts/base/escort_ai.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/bindings/scripts/base') diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 08adf6a534b..a0d2d4a0d66 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -181,9 +181,10 @@ void npc_escortAI::EnterEvadeMode() debug_log("TSCR: EscortAI has left combat and is now returning to last point"); } else + { m_creature->GetMotionMaster()->MoveTargetedHome(); - - Reset(); + Reset(); + } } bool npc_escortAI::IsPlayerOrGroupInRange() @@ -302,8 +303,10 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) void npc_escortAI::UpdateEscortAI(const uint32 uiDiff) { - if (CanMelee && UpdateVictim()) - DoMeleeAttackIfReady(); + if (!CanMelee && !UpdateVictim()) + return; + + DoMeleeAttackIfReady(); } void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) -- cgit v1.2.3