mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-27 20:32:21 +01:00
Core/SAI: Don't clear stored pathid if it changed after processing waypoint events (#26334)
(cherry picked from commit 8b0de23d0e)
# Conflicts:
# src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user