From df89c6b6ce6399c408ccf5538944bee5c34a6338 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Thu, 20 Jun 2019 20:45:52 +0300 Subject: [PATCH] Make unarmed creature attacks affect shield condition again (bug #5069) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/combat.cpp | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4881cf43..f1e2614e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,7 @@ Bug #5050: Invalid spell effects are not handled gracefully Bug #5056: Calling Cast function on player doesn't equip the spell but casts it Bug #5060: Magic effect visuals stop when death animation begins instead of when it ends + Bug #5069: Blocking creatures' attacks doesn't degrade shields Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index da62f6c08..68c94b9ee 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -115,16 +115,13 @@ namespace MWMechanics if (Misc::Rng::roll0to99() < x) { - if (!(weapon.isEmpty() && !attacker.getClass().isNpc())) // Unarmed creature attacks don't affect armor condition - { - // Reduce shield durability by incoming damage - int shieldhealth = shield->getClass().getItemHealth(*shield); + // Reduce shield durability by incoming damage + int shieldhealth = shield->getClass().getItemHealth(*shield); - shieldhealth -= std::min(shieldhealth, int(damage)); - shield->getCellRef().setCharge(shieldhealth); - if (shieldhealth == 0) - inv.unequipItem(*shield, blocker); - } + shieldhealth -= std::min(shieldhealth, int(damage)); + shield->getCellRef().setCharge(shieldhealth); + if (shieldhealth == 0) + inv.unequipItem(*shield, blocker); // Reduce blocker fatigue const float fFatigueBlockBase = gmst.find("fFatigueBlockBase")->mValue.getFloat(); const float fFatigueBlockMult = gmst.find("fFatigueBlockMult")->mValue.getFloat();