mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
refactor(Core/Creature): Calculate BaseArmor as float (#17448)
This commit is contained in:
@@ -535,7 +535,7 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
||||
|
||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(GetLevel(), cInfo->unit_class);
|
||||
float armor = (float)stats->GenerateArmor(cInfo); /// @todo: Why is this treated as uint32 when it's a float?
|
||||
float armor = stats->GenerateArmor(cInfo);
|
||||
SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, armor);
|
||||
SetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(cInfo->resistance[SPELL_SCHOOL_HOLY]));
|
||||
SetModifierValue(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE, float(cInfo->resistance[SPELL_SCHOOL_FIRE]));
|
||||
|
||||
@@ -292,7 +292,7 @@ struct CreatureBaseStats
|
||||
{
|
||||
uint32 BaseHealth[MAX_EXPANSIONS];
|
||||
uint32 BaseMana;
|
||||
uint32 BaseArmor;
|
||||
float BaseArmor;
|
||||
uint32 AttackPower;
|
||||
uint32 RangedAttackPower;
|
||||
float BaseDamage[MAX_EXPANSIONS];
|
||||
@@ -313,9 +313,9 @@ struct CreatureBaseStats
|
||||
return uint32(std::ceil(BaseMana * info->ModMana));
|
||||
}
|
||||
|
||||
uint32 GenerateArmor(CreatureTemplate const* info) const
|
||||
float GenerateArmor(CreatureTemplate const* info) const
|
||||
{
|
||||
return uint32(std::ceil(BaseArmor * info->ModArmor));
|
||||
return std::ceil(BaseArmor * info->ModArmor);
|
||||
}
|
||||
|
||||
float GenerateBaseDamage(CreatureTemplate const* info) const
|
||||
|
||||
Reference in New Issue
Block a user