Merge pull request #166 from badgerman/bug-1504-shipdamage-combat

Ships not getting damage in short battles.
This commit is contained in:
Enno Rehling 2015-04-09 14:53:10 +02:00
commit f320a50853
1 changed files with 12 additions and 11 deletions

View File

@ -1282,11 +1282,19 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
} }
assert(dt.index < du->number); assert(dt.index < du->number);
df->person[dt.index].hp -= rda; if (rda>0) {
if (u_race(au) == get_race(RC_DAEMON)) { df->person[dt.index].hp -= rda;
vampirism(at, 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 (df->person[dt.index].hp > 0) { /* Hat überlebt */
if (bdebug) { if (bdebug) {
fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n", fprintf(bdebug, "Damage %d, armor %d: %d -> %d HP\n",
@ -2712,13 +2720,6 @@ static void aftermath(battle * b)
if (flags) { if (flags) {
fset(du, 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) { if (df->alive && df->alive == du->number) {
du->hp = sum_hp; du->hp = sum_hp;
continue; /* nichts passiert */ continue; /* nichts passiert */