forked from teamnwah/openmw-tes3coop
Merge pull request #1581
This commit is contained in:
commit
b12cd1f5b2
1 changed files with 9 additions and 0 deletions
|
@ -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…
Reference in a new issue