aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorccrs <ccrsdev1992@gmail.com>2017-01-06 23:39:16 +0100
committerccrs <ccrsdev1992@gmail.com>2017-01-06 23:39:16 +0100
commita58505eaf8e8a97b7cab64608d88497a127f7465 (patch)
treef92d6a7c5d6f5305c76521ff052d4e9e345681ed /src
parent75fe9ebd7aa254282f89d47caa18b6c2e84170c2 (diff)
cb634e6fba followup
updates #18401
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp3
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp5
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 e953978bab4..fab0e8d00a8 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -308,7 +308,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 16206f91d58..f46860dce68 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -473,7 +473,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*/)