Core/SAI: Fix SMART_EVENT_WAYPOINT_START not being called at every waypoint checking wrong path id parameter

Port From (https://github.com/TrinityCore/TrinityCore/commit/c2d2df96dbe8e31e27283f73bad576ab42a3d579)
This commit is contained in:
hondacrx
2022-04-28 10:36:37 -04:00
parent 4c6ba41fe8
commit ec88268d0f
3 changed files with 7 additions and 18 deletions
+3 -10
View File
@@ -114,11 +114,9 @@ namespace Game.AI
if (invoker && invoker.IsPlayer())
{
_escortNPCFlags = me.m_unitData.NpcFlags[0];
me.SetNpcFlags((NPCFlags)0);
me.SetNpcFlags(0);
}
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, _currentWaypointNode, GetScript().GetPathId());
me.GetMotionMaster().MovePath(_path, _repeatWaypointPath);
}
@@ -394,17 +392,12 @@ namespace Game.AI
public override void WaypointPathStarted(uint pathId)
{
if (!HasEscortState(SmartEscortState.Escorting))
{
// @todo remove the constant 1 at some point, it's never anything different
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, 1, pathId);
return;
}
// SmartAI::WaypointStarted() already handles the case of starting the 1st waypoint
}
public override void WaypointStarted(uint nodeId, uint pathId)
{
GetScript().ProcessEventsFor(SmartEvents.WaypointStart, null, nodeId, pathId);
}
public override void WaypointReached(uint nodeId, uint pathId)