mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/SAI: Fix SMART_ACTION_WP_RESUME actually pausing next waypoint if the current path was not paused
Fixes #25519
(cherry picked from commit 5be7c2ad4f)
This commit is contained in:
@@ -136,6 +136,17 @@ void SmartAI::PausePath(uint32 delay, bool forced)
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, nullptr, _currentWaypointNode, GetScript()->GetPathId());
|
||||
}
|
||||
|
||||
bool SmartAI::CanResumePath()
|
||||
{
|
||||
if (!HasEscortState(SMART_ESCORT_ESCORTING))
|
||||
{
|
||||
// The whole resume logic doesn't support this case
|
||||
return false;
|
||||
}
|
||||
|
||||
return HasEscortState(SMART_ESCORT_PAUSED);
|
||||
}
|
||||
|
||||
void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail)
|
||||
{
|
||||
if (!HasEscortState(SMART_ESCORT_ESCORTING))
|
||||
|
||||
@@ -52,6 +52,7 @@ class TC_GAME_API SmartAI : public CreatureAI
|
||||
void StartPath(bool run = false, uint32 pathId = 0, bool repeat = false, Unit* invoker = nullptr, uint32 nodeId = 1);
|
||||
bool LoadPath(uint32 entry);
|
||||
void PausePath(uint32 delay, bool forced = false);
|
||||
bool CanResumePath();
|
||||
void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false);
|
||||
void EndPath(bool fail = false);
|
||||
void ResumePath();
|
||||
|
||||
@@ -1489,7 +1489,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
// Set the timer to 1 ms so the path will be resumed on next update loop
|
||||
ENSURE_AI(SmartAI, me->AI())->SetWPPauseTimer(1);
|
||||
if (ENSURE_AI(SmartAI, me->AI())->CanResumePath())
|
||||
ENSURE_AI(SmartAI, me->AI())->SetWPPauseTimer(1);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_ORIENTATION:
|
||||
|
||||
Reference in New Issue
Block a user