Core/Movement: Fix WaypointMovementGenerator ignoring EscortAI::SetEscortPaused() on Gossip Hello (#24005)

Fix WaypointMovementGenerator ignoring EscortAI::SetEscortPaused() when talking to a NPC, scheduling a 3 minutes pause on the WaypointMovementGenerator even if it was already disabled with no timer, waiting for the player to select a gossip entry to resume the movement.

(cherry picked from commit a9e534762f)
This commit is contained in:
Giacomo Pozzoni
2020-02-01 14:47:06 +01:00
committed by Shauren
parent 9124fd1f1f
commit f1f1bc01ba

View File

@@ -56,6 +56,10 @@ void WaypointMovementGenerator<Creature>::Pause(uint32 timer/* = 0*/)
{
if (timer)
{
// Don't try to paused an already paused generator
if (HasFlag(MOVEMENTGENERATOR_FLAG_PAUSED))
return;
AddFlag(MOVEMENTGENERATOR_FLAG_TIMED_PAUSED);
_nextMoveTime.Reset(timer);
RemoveFlag(MOVEMENTGENERATOR_FLAG_PAUSED);