diff options
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 3 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index fd5720d2eb1..666f19074e9 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -928,7 +928,8 @@ void SmartAI::UpdatePath(uint32 diff) // handle pause if (HasEscortState(SMART_ESCORT_PAUSED) && (_waypointReached || _waypointPauseForced)) { - if (!me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING)) + // Resume only if there was a pause timer set + if (_waypointPauseTimer && !me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING)) { if (_waypointPauseTimer <= diff) ResumePath(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index d8787c64e7b..1eed9259906 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1469,7 +1469,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; uint32 delay = e.action.wpPause.delay; - ENSURE_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); + ENSURE_AI(SmartAI, me->AI())->PausePath(delay, true); break; } case SMART_ACTION_WP_STOP: @@ -1488,7 +1488,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsSmart()) break; - ENSURE_AI(SmartAI, me->AI())->SetWPPauseTimer(0); + // Set the timer to 1 ms so the path will be resumed on next update loop + ENSURE_AI(SmartAI, me->AI())->SetWPPauseTimer(1); break; } case SMART_ACTION_SET_ORIENTATION: |