Core/Movement: fixed spline data sent for anim tiers
This commit is contained in:
1 parent
f46b6f0797
commit
4172c16de6
4 files changed
+9
-12
No files matched your search
@@ -343,13 +343,13 @@ void MotionMaster::MoveCloserAndStop(uint32 id, Unit* target, float distance)
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional<int32> tierTransitionId /*= { }*/, Optional<float> velocity /*= { }*/)
|
||||
void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional<float> velocity /*= { }*/)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveLand: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
|
||||
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.MoveTo(PositionToVector3(pos), false);
|
||||
init.SetAnimation(AnimTier::Ground, tierTransitionId.value_or(1));
|
||||
init.SetAnimation(AnimTier::Ground);
|
||||
init.SetSmooth();
|
||||
init.SetFly();
|
||||
if (velocity)
|
||||
@@ -357,14 +357,14 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, Optional<int32> tier
|
||||
Mutate(new GenericMovementGenerator(std::move(init), EFFECT_MOTION_TYPE, id), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, Optional<int32> tierTransitionId /*= { }*/, Optional<float> velocity /*= { }*/)
|
||||
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, Optional<float> velocity /*= { }*/)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveTakeoff: '%s', landing point Id: %u (X: %f, Y: %f, Z: %f)", _owner->GetGUID().ToString().c_str(), id, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
|
||||
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.MoveTo(PositionToVector3(pos), false);
|
||||
init.SetSmooth();
|
||||
init.SetAnimation(AnimTier::Fly, tierTransitionId.value_or(2));
|
||||
init.SetAnimation(AnimTier::Fly);
|
||||
init.SetFly(); // ensure smooth animation even if gravity is disabled after calling this function
|
||||
if (velocity)
|
||||
init.SetVelocity(velocity.value());
|
||||
|
||||
@@ -167,8 +167,8 @@ class TC_GAME_API MotionMaster
|
||||
void MoveCloserAndStop(uint32 id, Unit* target, float distance);
|
||||
|
||||
// These two movement types should only be used with creatures having landing/takeoff animations
|
||||
void MoveLand(uint32 id, Position const& pos, Optional<int32> tierTransitionId = { }, Optional<float> velocity = { });
|
||||
void MoveTakeoff(uint32 id, Position const& pos, Optional<int32> tierTransitionId = { }, Optional<float> velocity = { });
|
||||
void MoveLand(uint32 id, Position const& pos, Optional<float> velocity = { });
|
||||
void MoveTakeoff(uint32 id, Position const& pos, Optional<float> velocity = { });
|
||||
|
||||
void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE, bool generatePath = false);
|
||||
void MoveCharge(PathGenerator const& path, float speed = SPEED_CHARGE);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Movement
|
||||
/* Plays animation after movement done
|
||||
* can't be combined with parabolic movement
|
||||
*/
|
||||
void SetAnimation(AnimTier anim, uint32 tierTransitionId = 0, Milliseconds transitionStartTime = 0ms);
|
||||
void SetAnimation(AnimTier anim, Milliseconds transitionStartTime = 0ms);
|
||||
|
||||
/* Adds final facing animation
|
||||
* sets unit's facing to specified point/angle after all path done
|
||||
@@ -189,15 +189,13 @@ namespace Movement
|
||||
args.flags.Parabolic = true;
|
||||
}
|
||||
|
||||
inline void MoveSplineInit::SetAnimation(AnimTier anim, uint32 tierTransitionId /*= 0*/, Milliseconds transitionStartTime /*= 0ms*/)
|
||||
inline void MoveSplineInit::SetAnimation(AnimTier anim, Milliseconds transitionStartTime /*= 0ms*/)
|
||||
{
|
||||
args.effect_start_time_percent = 0.f;
|
||||
args.effect_start_time = transitionStartTime;
|
||||
args.animTier.emplace();
|
||||
args.animTier->TierTransitionId = tierTransitionId;
|
||||
args.animTier->AnimTier = anim;
|
||||
if (!tierTransitionId)
|
||||
args.flags.Animation = true;
|
||||
args.flags.Animation = true;
|
||||
}
|
||||
|
||||
inline void MoveSplineInit::DisableTransportPathTransformations() { args.TransformForTransport = false; }
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace Movement
|
||||
|
||||
struct AnimTierTransition
|
||||
{
|
||||
uint32 TierTransitionId = 0;
|
||||
::AnimTier AnimTier = ::AnimTier(0);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user