mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Core/SAI: Fix SMART_EVENT_WAYPOINT_START not being called at every waypoint checking wrong path id parameter
Remove multiple calls to SMART_EVENT_WAYPOINT_START for the 1st waypoint.
Closes #24760
(cherry picked from commit b3694bf47b)
This commit is contained in:
@@ -73,8 +73,6 @@ void SmartAI::StartPath(bool run/* = false*/, uint32 pathId/* = 0*/, bool repeat
|
||||
me->SetNpcFlags((NPCFlags)0);
|
||||
}
|
||||
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, _currentWaypointNode, GetScript()->GetPathId());
|
||||
|
||||
me->GetMotionMaster()->MovePath(_path, _repeatWaypointPath);
|
||||
}
|
||||
|
||||
@@ -347,17 +345,12 @@ bool SmartAI::IsEscortInvokerInRange()
|
||||
///@todo move escort related logic
|
||||
void SmartAI::WaypointPathStarted(uint32 pathId)
|
||||
{
|
||||
if (!HasEscortState(SMART_ESCORT_ESCORTING))
|
||||
{
|
||||
// @todo remove the constant 1 at some point, it's never anything different
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, 1, pathId);
|
||||
return;
|
||||
}
|
||||
// SmartAI::WaypointStarted() already handles the case of starting the 1st waypoint
|
||||
}
|
||||
|
||||
///@todo Implement new smart event SMART_EVENT_WAYPOINT_STARTED
|
||||
void SmartAI::WaypointStarted(uint32 /*nodeId*/, uint32 /*pathId*/)
|
||||
void SmartAI::WaypointStarted(uint32 nodeId, uint32 pathId)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, nodeId, pathId);
|
||||
}
|
||||
|
||||
void SmartAI::WaypointReached(uint32 nodeId, uint32 pathId)
|
||||
|
||||
@@ -3474,13 +3474,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_TRANSPORT_RELOCATE:
|
||||
case SMART_EVENT_WAYPOINT_START:
|
||||
{
|
||||
if (e.event.waypoint.pathID && var0 != e.event.waypoint.pathID)
|
||||
if (e.event.transportRelocate.pointID && var0 != e.event.transportRelocate.pointID)
|
||||
return;
|
||||
ProcessAction(e, unit, var0);
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_WAYPOINT_START:
|
||||
case SMART_EVENT_WAYPOINT_REACHED:
|
||||
case SMART_EVENT_WAYPOINT_RESUMED:
|
||||
case SMART_EVENT_WAYPOINT_PAUSED:
|
||||
|
||||
Reference in New Issue
Block a user