fix(Core/Unit): Introduce animtier to malygos to fix flying animations (#24067)

This commit is contained in:
killerwife
2025-12-10 05:09:21 +01:00
committed by GitHub
parent a54d1845e5
commit b73028f6f5
9 changed files with 49 additions and 36 deletions
+7 -7
View File
@@ -471,7 +471,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
*
* For transition movement between the ground and the air, use MoveLand or MoveTakeoff instead.
*/
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement, float speed, float orientation, bool generatePath, bool forceDestination, MovementSlot slot)
void MotionMaster::MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement, float speed, float orientation, bool generatePath, bool forceDestination, MovementSlot slot, std::optional<AnimTier> animTier)
{
if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE))
return;
@@ -479,12 +479,12 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, ForcedMovemen
if (_owner->IsPlayer())
{
LOG_DEBUG("movement.motionmaster", "Player ({}) targeted point (Id: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination), slot);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination, animTier), slot);
}
else
{
LOG_DEBUG("movement.motionmaster", "Creature ({}) targeted point (ID: {} X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), id, x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination), slot);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, forcedMovement, speed, orientation, nullptr, generatePath, forceDestination, animTier), slot);
}
}
@@ -556,7 +556,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed /* = 0.0
init.SetVelocity(speed);
}
init.SetAnimation(Movement::ToGround);
init.SetAnimation(AnimTier::Ground);
Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_ACTIVE);
}
@@ -590,7 +590,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed /* =
init.SetVelocity(speed);
if (!skipAnimation)
init.SetAnimation(Movement::ToFly);
init.SetAnimation(AnimTier::Hover);
Mutate(new EffectMovementGenerator(init, id), MOTION_SLOT_ACTIVE);
}
@@ -727,12 +727,12 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id,
if (_owner->IsPlayer())
{
LOG_DEBUG("movement.motionmaster", "Player ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED);
Mutate(new PointMovementGenerator<Player>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, std::nullopt, targetGUID), MOTION_SLOT_CONTROLLED);
}
else
{
LOG_DEBUG("movement.motionmaster", "Creature ({}) charge point (X: {} Y: {} Z: {})", _owner->GetGUID().ToString(), x, y, z);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, targetGUID), MOTION_SLOT_CONTROLLED);
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, FORCED_MOVEMENT_NONE, speed, orientation, path, generatePath, generatePath, std::nullopt, targetGUID), MOTION_SLOT_CONTROLLED);
}
}