mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 16:39:08 +01:00
Core/Game: Include cleanup part 5
* ObjectMgr.h * Player.h * Unit.h * G3D should no longer propagate everywhere from Spline/MotionMaster
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user