From f68be23f691439c8670f55070e3264ed37839e01 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 9 Apr 2015 14:30:49 +0200 Subject: [PATCH] damage taken in the first round of combat does not cause ships to get flagged for damage. --- src/battle.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/battle.c b/src/battle.c index d139280be..1720e222a 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1282,11 +1282,19 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) } assert(dt.index < du->number); - df->person[dt.index].hp -= rda; - if (u_race(au) == get_race(RC_DAEMON)) { - vampirism(at, rda); - } + if (rda>0) { + df->person[dt.index].hp -= rda; + if (u_race(au) == get_race(RC_DAEMON)) { + vampirism(at, rda); + } + if (b->turn>1) { + /* someone on the ship got damaged, damage the ship */ + ship *sh = du->ship ? du->ship : leftship(du); + if (sh) + fset(sh, SF_DAMAGED); + } + } if (df->person[dt.index].hp > 0) { /* Hat überlebt */ if (bdebug) { fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n", @@ -2712,13 +2720,6 @@ static void aftermath(battle * b) if (flags) { fset(du, flags); } - if (sum_hp + df->run.hp < du->hp) { - /* someone on the ship got damaged, damage the ship */ - ship *sh = du->ship ? du->ship : leftship(du); - if (sh) - fset(sh, SF_DAMAGED); - } - if (df->alive && df->alive == du->number) { du->hp = sum_hp; continue; /* nichts passiert */