diff options
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartAI.cpp | 13 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 4 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 3e58a5ec3eb..e4a4d953535 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -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) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index b17a06cab2b..e613b418bfb 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -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: |