mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Revert "Core/Movement: Added support to change orientation in MovePoint function (#18893)"
This reverts commit bc95fce93f.
See #18893.
This commit is contained in:
@@ -321,18 +321,18 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, float o, bool generatePath)
|
||||
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generatePath)
|
||||
{
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f O: %f).", _owner->GetGUID().GetCounter(), id, x, y, z, o);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, o, generatePath), MOTION_SLOT_ACTIVE);
|
||||
TC_LOG_DEBUG("misc", "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f O: %f).",
|
||||
_owner->GetEntry(), _owner->GetGUID().GetCounter(), id, x, y, z, o);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, o, generatePath), MOTION_SLOT_ACTIVE);
|
||||
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f).",
|
||||
_owner->GetEntry(), _owner->GetGUID().GetCounter(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,13 +393,13 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed /*= SPEED_C
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "Player (GUID: %u) charged point (X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, 0.0f, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) charged point (X: %f Y: %f Z: %f).",
|
||||
_owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, 0.0f, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,16 +126,9 @@ class TC_GAME_API MotionMaster
|
||||
void MoveFleeing(Unit* enemy, uint32 time = 0);
|
||||
void MovePoint(uint32 id, Position const& pos, bool generatePath = true)
|
||||
{
|
||||
if (pos.GetOrientation())
|
||||
MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.GetOrientation(), generatePath);
|
||||
else
|
||||
MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath);
|
||||
MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath);
|
||||
}
|
||||
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true)
|
||||
{
|
||||
MovePoint(id, x, y, z, 0.0f, generatePath);
|
||||
}
|
||||
void MovePoint(uint32 id, float x, float y, float z, float o, bool generatePath = true);
|
||||
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true);
|
||||
|
||||
/* Makes the unit move toward the target until it is at a certain distance from it. The unit then stops.
|
||||
Only works in 2D.
|
||||
|
||||
@@ -42,8 +42,6 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
|
||||
init.MoveTo(i_x, i_y, i_z, m_generatePath);
|
||||
if (speed > 0.0f)
|
||||
init.SetVelocity(speed);
|
||||
if (i_o > 0.0f)
|
||||
init.SetFacing(i_o);
|
||||
init.Launch();
|
||||
|
||||
// Call for creature group update
|
||||
@@ -73,8 +71,6 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)
|
||||
init.MoveTo(i_x, i_y, i_z, m_generatePath);
|
||||
if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit
|
||||
init.SetVelocity(speed);
|
||||
if (i_o > 0.0f)
|
||||
init.SetFacing(i_o);
|
||||
init.Launch();
|
||||
|
||||
// Call for creature group update
|
||||
|
||||
@@ -26,8 +26,8 @@ template<class T>
|
||||
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
|
||||
{
|
||||
public:
|
||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _o, bool _generatePath, float _speed = 0.0f) : id(_id),
|
||||
i_x(_x), i_y(_y), i_z(_z), i_o(_o), speed(_speed), m_generatePath(_generatePath), i_recalculateSpeed(false) { }
|
||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, bool _generatePath, float _speed = 0.0f) : id(_id),
|
||||
i_x(_x), i_y(_y), i_z(_z), speed(_speed), m_generatePath(_generatePath), i_recalculateSpeed(false) { }
|
||||
|
||||
void DoInitialize(T*);
|
||||
void DoFinalize(T*);
|
||||
@@ -43,7 +43,7 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG
|
||||
void GetDestination(float& x, float& y, float& z) const { x = i_x; y = i_y; z = i_z; }
|
||||
private:
|
||||
uint32 id;
|
||||
float i_x, i_y, i_z, i_o;
|
||||
float i_x, i_y, i_z;
|
||||
float speed;
|
||||
bool m_generatePath;
|
||||
bool i_recalculateSpeed;
|
||||
@@ -53,7 +53,7 @@ class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
|
||||
{
|
||||
public:
|
||||
AssistanceMovementGenerator(float _x, float _y, float _z) :
|
||||
PointMovementGenerator<Creature>(0, _x, _y, _z, 0.0f, true) { }
|
||||
PointMovementGenerator<Creature>(0, _x, _y, _z, true) { }
|
||||
|
||||
MovementGeneratorType GetMovementGeneratorType() const override { return ASSISTANCE_MOTION_TYPE; }
|
||||
void Finalize(Unit*) override;
|
||||
|
||||
Reference in New Issue
Block a user