From 13e019ffee3be4cfc9e18f2bcbf384960c7589cc Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 20 Jun 2004 07:25:28 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix:=20Z=C3=A4hlung=20der=20M=C3=B6glichen?= =?UTF-8?q?=20Kontrahenten=20vergisst=20Versteinerung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/battle.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index ec68b1600..4e4f9a3ed 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -1397,30 +1397,30 @@ select_opponent(battle * b, troop at, int minrow, int maxrow) if (af->unit->race->flags & RCF_FLY) { /* flying races ignore min- and maxrow and can attack anyone fighting - * them */ + * them */ minrow = FIGHT_ROW; maxrow = BEHIND_ROW; } minrow = max(minrow, FIGHT_ROW); - - if (dt.fighter!=NULL && dt.indexalive) { - fighter * df = dt.fighter; - int row = get_unitrow(df); - if (row>=minrow && row<=maxrow) { - troop ot = df->person[dt.index].opponent; - if (ot.fighter==NULL || ot.index>=ot.fighter->alive) { - df->person[dt.index].opponent = at; - } - return dt; - } + + if (dt.fighter!=NULL && dt.indexalive-dt.fighter->removed) { + fighter * df = dt.fighter; + int row = get_unitrow(df); + if (row>=minrow && row<=maxrow) { + troop ot = df->person[dt.index].opponent; + if (ot.fighter==NULL || ot.index>=ot.fighter->alive-ot.fighter->removed) { + df->person[dt.index].opponent = at; + } + return dt; + } } dt = select_enemy(b, at.fighter, minrow, maxrow); if (dt.fighter!=NULL) { - fighter * df = dt.fighter; - troop ot = df->person[dt.index].opponent; - if (ot.fighter==NULL || ot.index>=ot.fighter->alive) { - df->person[dt.index].opponent = at; - } + fighter * df = dt.fighter; + troop ot = df->person[dt.index].opponent; + if (ot.fighter==NULL || ot.index>=ot.fighter->alive-ot.fighter->removed) { + df->person[dt.index].opponent = at; + } } return dt; }