Core/Unit: Ceil damage instead of rounding it

a0d5088850 followup, use std::ceil instead of std::round . This ensures at least 1 damage point will be done after applying armor reducing.
This commit is contained in:
jackpoz
2020-04-10 23:24:29 +02:00
parent b26302cdd0
commit 9c9f4d6d20

View File

@@ -1610,7 +1610,7 @@ void Unit::HandleEmoteCommand(uint32 emoteId)
damageReduction /= (1.0f + damageReduction);
RoundToInterval(damageReduction, 0.f, 0.75f);
return uint32(std::lroundf(std::max(damage * (1.0f - damageReduction), 0.0f)));
return uint32(std::ceilf(std::max(damage * (1.0f - damageReduction), 0.0f)));
}
/*static*/ uint32 Unit::CalcSpellResistedDamage(Unit const* attacker, Unit* victim, uint32 damage, SpellSchoolMask schoolMask, SpellInfo const* spellInfo)