fix(Core/Auras): SPELL_AURA_MOD_SCALE should scale additively instead… (#14425)

...multiplicatively

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Angelo Venturini
2023-01-02 20:43:20 -03:00
committed by GitHub
parent f65d229823
commit 9e18b86311
7 changed files with 41 additions and 21 deletions

View File

@@ -16864,6 +16864,14 @@ bool Unit::IsPolymorphed() const
return spellInfo->GetSpellSpecific() == SPELL_SPECIFIC_MAGE_POLYMORPH;
}
void Unit::RecalculateObjectScale()
{
int32 scaleAuras = GetTotalAuraModifier(SPELL_AURA_MOD_SCALE) + GetTotalAuraModifier(SPELL_AURA_MOD_SCALE_2);
float scale = GetNativeObjectScale() + CalculatePct(1.0f, scaleAuras);
float scaleMin = GetTypeId() == TYPEID_PLAYER ? 0.1f : 0.01f;
SetObjectScale(std::max(scale, scaleMin));
}
void Unit::SetDisplayId(uint32 modelId)
{
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);