From cf4e081179fa385ecb46ac39ddd05b636f37a527 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 9 Mar 2011 14:48:39 +0100 Subject: [PATCH] nobody ever profited from castle bonuses --- src/kernel/battle.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/kernel/battle.c b/src/kernel/battle.c index 5c1fa233f..2a7356a7c 100644 --- a/src/kernel/battle.c +++ b/src/kernel/battle.c @@ -3352,9 +3352,9 @@ fighter *make_fighter(battle * b, unit * u, side * s1, boolean attack) if (attack) { set_attacker(fig); } else { - building *b = u->building; - if (b && b->sizeleft >= u->number && playerrace(u->race)) { - fig->building = b; + building *bld = u->building; + if (bld && bld->sizeleft >= u->number && playerrace(u->race)) { + fig->building = bld; fig->building->sizeleft -= u->number; } } @@ -4062,6 +4062,11 @@ static boolean init_battle(region * r, battle ** bp) battle *b = NULL; unit *u; boolean fighting = false; + building *bu; + + /* Alle Mann raus aus der Burg! */ + for (bu = r->buildings; bu != NULL; bu = bu->next) + bu->sizeleft = bu->size; /* list_foreach geht nicht, wegen flucht */ for (u = r->units; u != NULL; u = u->next) { @@ -4428,7 +4433,6 @@ void do_battle(region * r) battle *b = NULL; boolean fighting = false; ship *sh; - building *bu; static int init_rules = 0; if (!init_rules) { @@ -4460,10 +4464,6 @@ void do_battle(region * r) join_allies(b); make_heroes(b); - /* Alle Mann raus aus der Burg! */ - for (bu = r->buildings; bu != NULL; bu = bu->next) - bu->sizeleft = bu->size; - /* make sure no ships are damaged initially */ for (sh = r->ships; sh; sh = sh->next) freset(sh, SF_DAMAGED);