From 154c2076a26e77cc0d85e4b1e6dd34e62692a060 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 3 Nov 2015 19:12:40 +0100 Subject: [PATCH] fixing bug 2149: projectile armor shall only protect against projectiles https://bugs.eressea.de/view.php?id=2149 --- src/battle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/battle.c b/src/battle.c index 6d7b7fb79..853c908d7 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1085,16 +1085,17 @@ int calculate_armor(troop dt, const weapon_type *dwtype, const weapon_type *awty int ar = 0, an, am; const armor_type *armor = select_armor(dt, false); const armor_type *shield = select_armor(dt, true); + bool missile = awtype && (awtype->flags&WTF_MISSILE); if (armor) { ar += armor->prot; - if (armor->projectile > 0 && chance(armor->projectile)) { + if (missile && armor->projectile > 0 && chance(armor->projectile)) { return -1; } } if (shield) { ar += shield->prot; - if (shield->projectile > 0 && chance(shield->projectile)) { + if (missile && shield->projectile > 0 && chance(shield->projectile)) { return -1; } }