mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 13:20:35 +00:00
Take in account armor condition in the armor rating calculation (bug #4246)
This commit is contained in:
parent
a4d8aef40d
commit
744859f327
@ -1129,6 +1129,15 @@ namespace MWClass
|
||||
else
|
||||
{
|
||||
ratings[i] = it->getClass().getEffectiveArmorRating(*it, ptr);
|
||||
|
||||
// Take in account armor condition
|
||||
const bool hasHealth = it->getClass().hasItemHealth(*it);
|
||||
if (hasHealth)
|
||||
{
|
||||
int armorHealth = it->getClass().getItemHealth(*it);
|
||||
int armorMaxHealth = it->getClass().getItemMaxHealth(*it);
|
||||
ratings[i] *= (float(armorHealth) / armorMaxHealth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user