From 6d00d3f28380dd0811a18913450b1dc4f07fef48 Mon Sep 17 00:00:00 2001 From: treeston Date: Wed, 14 Sep 2016 23:53:37 +0200 Subject: Core/Movement: Add new SplineChainMovementGenerator that allows accurate replication of sniffed waypoints in static sequences, along with DB facilities that allow loading of waypoints from DB. --- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/server/game/AI/ScriptedAI') diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index e87651224b9..89ad726b253 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -402,12 +402,11 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 wait void npc_escortAI::FillPointMovementListForCreature() { - ScriptPointVector const& movePoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry()); - if (movePoints.empty()) + ScriptPointVector const* movePoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry()); + if (!movePoints) return; - ScriptPointVector::const_iterator itrEnd = movePoints.end(); - for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr) + for (ScriptPointVector::const_iterator itr = movePoints->begin(); itr != movePoints->end(); ++itr) { Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime); WaypointList.push_back(point); @@ -563,11 +562,11 @@ bool npc_escortAI::SetNextWaypoint(uint32 pointId, bool setPosition, bool resetW bool npc_escortAI::GetWaypointPosition(uint32 pointId, float& x, float& y, float& z) { - ScriptPointVector const& waypoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry()); - if (waypoints.empty()) + ScriptPointVector const* waypoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry()); + if (!waypoints) return false; - for (ScriptPointVector::const_iterator itr = waypoints.begin(); itr != waypoints.end(); ++itr) + for (ScriptPointVector::const_iterator itr = waypoints->begin(); itr != waypoints->end(); ++itr) { if (itr->uiPointId == pointId) { -- cgit v1.2.3