diff options
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index ecc44114f85..ca6290d1379 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -141,13 +141,13 @@ void EscortAI::MovementInform(uint32 type, uint32 id) } else if (type == WAYPOINT_MOTION_TYPE) { - ASSERT(id < _path.nodes.size(), "EscortAI::MovementInform: referenced movement id (%u) points to non-existing node in loaded path (%s)", id, me->GetGUID().ToString().c_str()); - WaypointNode waypoint = _path.nodes[id]; + ASSERT(id < _path.Nodes.size(), "EscortAI::MovementInform: referenced movement id (%u) points to non-existing node in loaded path (%s)", id, me->GetGUID().ToString().c_str()); + WaypointNode waypoint = _path.Nodes[id]; - TC_LOG_DEBUG("scripts.ai.escortai", "EscortAI::MovementInform: waypoint node {} reached ({})", waypoint.id, me->GetGUID().ToString()); + TC_LOG_DEBUG("scripts.ai.escortai", "EscortAI::MovementInform: waypoint node {} reached ({})", waypoint.Id, me->GetGUID().ToString()); // last point - if (id == _path.nodes.size() - 1) + if (id == _path.Nodes.size() - 1) { _started = false; _ended = true; @@ -264,20 +264,14 @@ void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, float orientati Trinity::NormalizeMapCoord(x); Trinity::NormalizeMapCoord(y); - WaypointNode waypoint; - waypoint.id = id; - waypoint.x = x; - waypoint.y = y; - waypoint.z = z; - waypoint.orientation = orientation; - waypoint.moveType = run ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK; - waypoint.delay = waitTime.count(); - _path.nodes.push_back(std::move(waypoint)); + WaypointNode waypoint(id, x, y, z, orientation, waitTime.count()); + waypoint.MoveType = run ? WaypointMoveType::Run : WaypointMoveType::Walk; + _path.Nodes.push_back(std::move(waypoint)); } void EscortAI::ResetPath() { - _path.nodes.clear(); + _path.Nodes.clear(); } void EscortAI::LoadPath(uint32 pathId) @@ -294,7 +288,7 @@ void EscortAI::LoadPath(uint32 pathId) /// @todo get rid of this many variables passed in function. void EscortAI::Start(bool isActiveAttacker /* = true*/, ObjectGuid playerGUID /* = 0 */, Quest const* quest /* = nullptr */, bool instantRespawn /* = false */, bool canLoopPath /* = false */) { - if (_path.nodes.empty()) + if (_path.Nodes.empty()) { TC_LOG_ERROR("scripts.ai.escortai", "EscortAI::Start: (script: {}) path is empty ({})", me->GetScriptName(), me->GetGUID().ToString()); return; @@ -319,7 +313,7 @@ void EscortAI::Start(bool isActiveAttacker /* = true*/, ObjectGuid playerGUID /* return; } - if (_path.nodes.empty()) + if (_path.Nodes.empty()) { TC_LOG_ERROR("scripts.ai.escortai", "EscortAI::Start: (script: {}) is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn ({})", me->GetScriptName(), me->GetGUID().ToString()); return; @@ -348,7 +342,7 @@ void EscortAI::Start(bool isActiveAttacker /* = true*/, ObjectGuid playerGUID /* } TC_LOG_DEBUG("scripts.ai.escortai", "EscortAI::Start: (script: {}) started with {} waypoints. ActiveAttacker = {}, Player = {} ({})", - me->GetScriptName(), uint32(_path.nodes.size()), _activeAttacker, _playerGUID.ToString(), me->GetGUID().ToString()); + me->GetScriptName(), uint32(_path.Nodes.size()), _activeAttacker, _playerGUID.ToString(), me->GetGUID().ToString()); _started = false; AddEscortState(STATE_ESCORT_ESCORTING); |
