Merge pull request #1581

This commit is contained in:
scrawl 2017-12-08 20:00:15 +00:00
commit b12cd1f5b2
No known key found for this signature in database
GPG key ID: 2E6CC3676024C402

View file

@ -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);
}
}
}