From 047673175b29466b7ecbb3492da1d7caa1e2d22b Mon Sep 17 00:00:00 2001 From: ccrs Date: Fri, 6 Jan 2017 23:39:16 +0100 Subject: [PATCH] cb634e6fba followup updates #18401 --- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 3 ++- src/server/game/AI/SmartScripts/SmartAI.cpp | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 42839924ede..d7e41a65217 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -307,7 +307,8 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) else if (moveType == WAYPOINT_MOTION_TYPE) { //Call WP function - WaypointReached(pointId); + if (pointId < _path.size()) + WaypointReached(_path.at(pointId).id); //End of the line if (LastWP && LastWP == pointId) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 29ab861e149..cf87a3f90be 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -471,7 +471,10 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data) return; if (MovementType == WAYPOINT_MOTION_TYPE || (MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT)) - MovepointReached(Data); + { + if (Data < _path.size()) + MovepointReached(_path.at(Data).id); + } } void SmartAI::EnterEvadeMode(EvadeReason /*why*/)