From f054d324aa0fe95b5169c074b4251f80b0b99b01 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 26 Jul 2005 10:16:38 +0000 Subject: [PATCH] NEW RULE: aftermath marks either all or none of the fighters in an army (side) as having had a long battle. --- src/common/kernel/battle.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 43b6a00a3..c70d10329 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -37,7 +37,6 @@ #include "reports.h" #include "ship.h" #include "skill.h" -#include "spell.h" #include "unit.h" /* attributes includes */ @@ -2436,6 +2435,7 @@ aftermath(battle * b) int snumber = 0; fighter *df; boolean relevant = false; /* Kampf relevant für dieses Heer? */ + boolean active_army = false; /* anyone in this army done much? */ if (s->bf->lastturn+(b->has_tactics_turn?1:0)>1) { relevant = true; } @@ -2446,15 +2446,24 @@ aftermath(battle * b) int dead = du->number - df->alive - df->run.number; int sum_hp = 0; int n; + boolean involved = relevant && df->action_counter >= du->number; snumber += du->number; - if (relevant && df->action_counter >= du->number) { - ship * sh = du->ship?du->ship:leftship(du); + if (involved) { + ship * sh = du->ship?du->ship:leftship(du); if (sh) fset(sh, SF_DAMAGED); + } + if (active_army || involved) { + if (!active_army) { + /* make sur to stop everyone else in this army */ + fighter * fig; + cv_foreach(fig, s->fighters) { + if (fig==df) break; + fset(fig->unit, UFL_LONGACTION); + } cv_next(fig); + active_army = true; + } fset(du, UFL_LONGACTION); - /* TODO: das sollte hier weg sobald anderswo üb - * erall UFL_LONGACTION getestet wird. */ - set_order(&du->thisorder, NULL); } for (n = 0; n != df->alive; ++n) { if (df->person[n].hp > 0)