Core/SAI: Don't clear stored pathid if it changed after processing waypoint events

Port From (https://github.com/TrinityCore/TrinityCore/commit/8b0de23d0e4b15fce8dc8c67f9512f76804d6439)
This commit is contained in:
hondacrx
2021-04-28 10:36:17 -04:00
parent 2f031910b3
commit ad94721b7c
+3 -2
View File
@@ -289,14 +289,15 @@ namespace Game.AI
if (fail)
return;
GetScript().ProcessEventsFor(SmartEvents.WaypointEnded, null, _currentWaypointNode, GetScript().GetPathId());
uint pathid = GetScript().GetPathId();
GetScript().ProcessEventsFor(SmartEvents.WaypointEnded, null, _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)