Add missing empty attacker checks

0.6.3
Capostrophic 7 years ago committed by GitHub
parent bccba24c40
commit 6e9c08083d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -781,7 +781,7 @@ namespace MWClass
MWWorld::Ptr armor = ((armorslot != inv.end()) ? *armorslot : MWWorld::Ptr()); MWWorld::Ptr armor = ((armorslot != inv.end()) ? *armorslot : MWWorld::Ptr());
if(!armor.isEmpty() && armor.getTypeName() == typeid(ESM::Armor).name()) if(!armor.isEmpty() && armor.getTypeName() == typeid(ESM::Armor).name())
{ {
if (!(object.isEmpty() && !attacker.getClass().isNpc())) // Unarmed creature attacks don't affect armor condition if (attacker.isEmpty() || (!attacker.isEmpty() && !(object.isEmpty() && !attacker.getClass().isNpc()))) // Unarmed creature attacks don't affect armor condition
{ {
int armorhealth = armor.getClass().getItemHealth(armor); int armorhealth = armor.getClass().getItemHealth(armor);
armorhealth -= std::min(damageDiff, armorhealth); armorhealth -= std::min(damageDiff, armorhealth);

Loading…
Cancel
Save