diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index e005396c3cf..628eee9f764 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -244,14 +244,15 @@ void SmartAI::EndPath(bool fail) if (fail) return; - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, _currentWaypointNode, GetScript()->GetPathId()); + uint32 pathid = GetScript()->GetPathId(); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, _currentWaypointNode, pathid); if (_repeatWaypointPath) { if (IsAIControlled()) StartPath(_run, GetScript()->GetPathId(), _repeatWaypointPath); } - else + else if (pathid == GetScript()->GetPathId()) // if it's not the same pathid, our script wants to start another path; don't override it GetScript()->SetPathId(0); if (_despawnState == 1) |