fixing bug 2149: projectile armor shall only protect against projectiles

https://bugs.eressea.de/view.php?id=2149
This commit is contained in:
Enno Rehling 2015-11-03 19:12:40 +01:00
parent cfc31c6598
commit 154c2076a2
1 changed files with 3 additions and 2 deletions

View File

@ -1085,16 +1085,17 @@ int calculate_armor(troop dt, const weapon_type *dwtype, const weapon_type *awty
int ar = 0, an, am; int ar = 0, an, am;
const armor_type *armor = select_armor(dt, false); const armor_type *armor = select_armor(dt, false);
const armor_type *shield = select_armor(dt, true); const armor_type *shield = select_armor(dt, true);
bool missile = awtype && (awtype->flags&WTF_MISSILE);
if (armor) { if (armor) {
ar += armor->prot; ar += armor->prot;
if (armor->projectile > 0 && chance(armor->projectile)) { if (missile && armor->projectile > 0 && chance(armor->projectile)) {
return -1; return -1;
} }
} }
if (shield) { if (shield) {
ar += shield->prot; ar += shield->prot;
if (shield->projectile > 0 && chance(shield->projectile)) { if (missile && shield->projectile > 0 && chance(shield->projectile)) {
return -1; return -1;
} }
} }