fix(Core/Movement): Fix creatures not resuming movement after being talked to (#20945)

Fix creatures not resuming movement after being talked to
This commit is contained in:
Takenbacon
2024-12-18 11:19:31 -08:00
committed by GitHub
parent 4d349e87b5
commit c8734af4bc
2 changed files with 19 additions and 18 deletions
@@ -239,10 +239,6 @@ bool WaypointMovementGenerator<Creature>::DoUpdate(Creature* creature, uint32 di
return StartMove(creature);
}
else
{
if (creature->IsStopped())
Stop(sWorld->getIntConfig(CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER) * IN_MILLISECONDS);
else
{
bool finished = creature->movespline->Finalized();
// xinef: code to detect pre-empetively if we should start movement to next waypoint
@@ -256,7 +252,6 @@ bool WaypointMovementGenerator<Creature>::DoUpdate(Creature* creature, uint32 di
return StartMove(creature);
}
}
}
return true;
}
@@ -287,11 +282,17 @@ void WaypointMovementGenerator<Creature>::MovementInform(Creature* creature)
}
}
void WaypointMovementGenerator<Creature>::Pause(uint32 /*timer*/)
void WaypointMovementGenerator<Creature>::Pause(uint32 timer)
{
if (timer)
i_nextMoveTime.Reset(timer);
else
{
// No timer? Will be paused forever until ::Resume is called
stalled = true;
i_nextMoveTime.Reset(1);
}
}
void WaypointMovementGenerator<Creature>::Resume(uint32 /*overrideTimer/*/)
{
@@ -61,7 +61,7 @@ public:
void DoFinalize(Creature*);
void DoReset(Creature*);
bool DoUpdate(Creature*, uint32 diff);
void Pause(uint32 timer/* = 0*/);
void Pause(uint32 timer = 0);
void Resume(uint32 overrideTimer/* = 0*/);
void MovementInform(Creature*);