From 5778bc2c93344708f04d3cbbaea00a8c32dd52df Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 2 May 2017 09:59:04 +0200 Subject: [PATCH] no more than 4 critical hits --- src/battle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle.c b/src/battle.c index 81f0b635d..19f30e59c 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1205,11 +1205,12 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) if (type != AT_COMBATSPELL && type != AT_SPELL) { if (rule_damage & DAMAGE_CRITICAL) { double kritchance = (sk * 3 - sd) / 200.0; + int maxk = 4; kritchance = MAX(kritchance, 0.005); kritchance = MIN(0.9, kritchance); - while (chance(kritchance)) { + while (maxk-- && chance(kritchance)) { da += dice_rand(damage); } }