From 19db01af6778c13d64ba341777da23150de55f84 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 24 Mar 2021 20:55:51 +0100 Subject: [PATCH] new volcano damage calculation was broken. --- src/volcano.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/volcano.c b/src/volcano.c index f20cc413d..7df53b62c 100644 --- a/src/volcano.c +++ b/src/volcano.c @@ -92,6 +92,7 @@ int volcano_damage(unit* u, const char* dice) } for (i = 0; i != u->number; ++i) { + int h = hp + ((i < remain) ? 1 : 0); int damage = dice_rand(dice) - protect; if (damage > 0) { if (i == 0 || ac > 0) { @@ -99,32 +100,27 @@ int volcano_damage(unit* u, const char* dice) damage -= ac; } if (damage > 0) { - int h = hp + ((i < remain) ? 1 : 0); - if (damage >= h) { if (rc_cat && u_race(u) == rc_cat && ((rng_int() % 7) == 0)) { /* cats have nine lives */ - total += h; continue; } else if (healings > 0) { --healings; if (resurrect_unit(u)) { /* take no damage at all */ - total += h; continue; } } ++dead; + damage = h; } - else { - total += (h - damage); - } + total += damage; } } } scale_number(u, u->number - dead); - u->hp = total; + u->hp -= total; return dead; }