diff options
| author | treeston <treeston.mmoc@gmail.com> | 2016-09-14 23:53:37 +0200 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2016-09-20 00:37:36 +0200 |
| commit | 6d00d3f28380dd0811a18913450b1dc4f07fef48 (patch) | |
| tree | 4367f426d2c48a718cade01216e2da407fa9633f /src/server/game/AI/ScriptedAI | |
| parent | 0b658f789cab005c080941e2be33e855debcbfde (diff) | |
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.
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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) { |
