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

View File

@@ -596,7 +596,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
DisableSpline();
if (movespline->HasAnimation() && IsCreature() && IsAlive())
SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, movespline->GetAnimationType());
SetAnimTier(AnimTier(movespline->GetAnimationType()));
}
// pussywizard: update always! not every 400ms, because movement generators need the actual position
@@ -15284,6 +15284,11 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
return spellInfo->GetMinRange(!IsHostileTo(target));
}
void Unit::SetAnimTier(AnimTier animTier)
{
SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_ANIM_TIER, uint8(animTier));
}
uint32 Unit::GetCreatureType() const
{
if (IsPlayer())

View File

@@ -774,6 +774,8 @@ public:
inline bool IsCrowdControlled() const { return HasFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_STUNNED)); }
inline bool IsImmobilizedState() const { return HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); }
void SetAnimTier(AnimTier animTier);
/*********************************************************/
/*** UNIT TYPES, CLASSES, RACES... ***/
/*********************************************************/