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:
@@ -289,14 +289,15 @@ namespace Game.AI
|
|||||||
if (fail)
|
if (fail)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GetScript().ProcessEventsFor(SmartEvents.WaypointEnded, null, _currentWaypointNode, GetScript().GetPathId());
|
uint pathid = GetScript().GetPathId();
|
||||||
|
GetScript().ProcessEventsFor(SmartEvents.WaypointEnded, null, _currentWaypointNode, pathid);
|
||||||
|
|
||||||
if (_repeatWaypointPath)
|
if (_repeatWaypointPath)
|
||||||
{
|
{
|
||||||
if (IsAIControlled())
|
if (IsAIControlled())
|
||||||
StartPath(_run, GetScript().GetPathId(), _repeatWaypointPath);
|
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);
|
GetScript().SetPathId(0);
|
||||||
|
|
||||||
if (_despawnState == 1)
|
if (_despawnState == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user