mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/Movement: Correct MotionMaster and fix a crash.
This commit is contained in:
@@ -280,18 +280,18 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MovePoint(uint32 id, float x, float y, float z)
|
||||
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generatePath)
|
||||
{
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, true), MOTION_SLOT_ACTIVE);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, true), MOTION_SLOT_ACTIVE);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ void MotionMaster::MoveFall(uint32 id/*=0*/)
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
|
||||
void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, bool generatePath)
|
||||
{
|
||||
if (Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
|
||||
return;
|
||||
@@ -404,13 +404,13 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id)
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,13 +154,13 @@ class MotionMaster //: private std::stack<MovementGenerator *>
|
||||
void MoveFleeing(Unit* enemy, uint32 time = 0);
|
||||
void MovePoint(uint32 id, const Position &pos)
|
||||
{ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ); }
|
||||
void MovePoint(uint32 id, float x, float y, float z);
|
||||
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = false);
|
||||
|
||||
// These two movement types should only be used with creatures having landing/takeoff animations
|
||||
void MoveLand(uint32 id, Position const& pos, float speed);
|
||||
void MoveTakeoff(uint32 id, Position const& pos, float speed);
|
||||
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE);
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, bool generatePath = false);
|
||||
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ);
|
||||
void MoveJumpTo(float angle, float speedXY, float speedZ);
|
||||
void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = 0);
|
||||
|
||||
Reference in New Issue
Block a user