Core/SAI: Fix SMART_ACTION_WP_PAUSE with 0 delay pausing the path only for 1 world loop update (#25471)

* Core/SAI: Fix SMART_ACTION_WP_PAUSE with 0 delay pausing the path only for 1 world loop update

* Add code comments

* Remove special handling of SMART_ACTION_WP_PAUSE in SMART_EVENT_WAYPOINT_REACHED

(cherry picked from commit 7dd51ae6d9)
This commit is contained in:
Giacomo Pozzoni
2020-09-19 23:32:12 +02:00
committed by Shauren
parent 1a073e2df0
commit 60519e947f
2 changed files with 5 additions and 3 deletions
@@ -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: