aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Movement/MotionMaster.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-06-04 01:00:45 +0200
committerShauren <shauren.trinity@gmail.com>2017-06-04 01:00:45 +0200
commitb453e124231a90321fe79fbf3a62acdcfa54a691 (patch)
treeca2a815b923080385ed9a3a69aefe20ee54a7969 /src/server/game/Movement/MotionMaster.cpp
parentec72a59b08e71ebc7ba00b32592ec903a7995a84 (diff)
Core/Game: Include cleanup part 5
* ObjectMgr.h * Player.h * Unit.h * G3D should no longer propagate everywhere from Spline/MotionMaster
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r--src/server/game/Movement/MotionMaster.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 9618146160e..6d60c96d72a 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -21,6 +21,7 @@
#include "Creature.h"
#include "ScriptSystem.h"
#include "Log.h"
+#include "Map.h"
#include "ConfusedMovementGenerator.h"
#include "FleeingMovementGenerator.h"
#include "HomeMovementGenerator.h"
@@ -457,7 +458,7 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool
init.Launch();
}
-void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk, bool fly)
+void MotionMaster::MoveSmoothPath(uint32 pointId, Position const* pathPoints, size_t pathSize, bool walk, bool fly)
{
Movement::MoveSplineInit init(_owner);
if (fly)
@@ -466,7 +467,12 @@ void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints
init.SetUncompressed();
}
- Movement::PointsArray path(pathPoints, pathPoints + pathSize);
+ Movement::PointsArray path;
+ path.reserve(pathSize);
+ std::transform(pathPoints, pathPoints + pathSize, std::back_inserter(path), [](Position const& point)
+ {
+ return G3D::Vector3(point.GetPositionX(), point.GetPositionY(), point.GetPositionZ());
+ });
init.MovebyPath(path);
init.SetSmooth();
init.SetWalk(walk);
@@ -488,7 +494,7 @@ void MotionMaster::MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool w
TC_LOG_ERROR("misc", "MotionMaster::MoveAlongSplineChain: non-creature %s tried to walk along DB spline chain. Ignoring.", _owner->GetGUID().ToString().c_str());
return;
}
- SplineChain const* chain = sScriptSystemMgr->GetSplineChain(owner, dbChainId);
+ std::vector<SplineChainLink> const* chain = sScriptSystemMgr->GetSplineChain(owner, dbChainId);
if (!chain)
{
TC_LOG_ERROR("misc", "MotionMaster::MoveAlongSplineChain: creature with entry %u tried to walk along non-existing spline chain with DB id %u.", owner->GetEntry(), dbChainId);