aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/ScriptedAI
diff options
context:
space:
mode:
authorCarbenium <carbenium@outlook.com>2020-07-25 21:47:10 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-23 23:34:40 +0100
commit14e9513cea0a3b4ce58bdcc8d5ce785c9417c35a (patch)
treeca6131b3cafa8d7529550f42bb6f81cbd0bc9776 /src/server/game/AI/ScriptedAI
parente660b870e95cb8289fc9f82fe53e8b6637a46594 (diff)
Core/EscortAI: std::chrono-ify AddWaypoint
(cherry picked from commit 4b9fdc5d3d1278269aaf218cea94f23688e4bca1)
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp4
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 46085bf79ab..e02902ec4bb 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -252,7 +252,7 @@ void EscortAI::UpdateEscortAI(uint32 /*diff*/)
DoMeleeAttackIfReady();
}
-void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientation/* = 0*/, uint32 waitTime/* = 0*/)
+void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientation/* = 0*/, Milliseconds waitTime/* = 0s*/)
{
Trinity::NormalizeMapCoord(x);
Trinity::NormalizeMapCoord(y);
@@ -264,7 +264,7 @@ void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientati
waypoint.z = z;
waypoint.orientation = orientation;
waypoint.moveType = _running ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
- waypoint.delay = waitTime;
+ waypoint.delay = waitTime.count();
waypoint.eventId = 0;
waypoint.eventChance = 100;
_path.nodes.push_back(std::move(waypoint));
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
index 9ac6101e5b7..ef0a3ec47f5 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h
@@ -48,7 +48,7 @@ struct TC_GAME_API EscortAI : public ScriptedAI
void UpdateAI(uint32 diff) override; // the "internal" update, calls UpdateEscortAI()
virtual void UpdateEscortAI(uint32 diff); // used when it's needed to add code in update (abilities, scripted events, etc)
- void AddWaypoint(uint32 id, float x, float y, float z, float orientation = 0.f, uint32 waitTime = 0); // waitTime is in ms
+ void AddWaypoint(uint32 id, float x, float y, float z, float orientation = 0.f, Milliseconds waitTime = 0s);
void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = ObjectGuid::Empty, Quest const* quest = nullptr, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true);
void SetRun(bool on = true);