forked from github/server
Bugfix: Zählung der Möglichen Kontrahenten vergisst Versteinerung
This commit is contained in:
parent
afc42b9c4c
commit
13e019ffee
|
@ -1397,30 +1397,30 @@ select_opponent(battle * b, troop at, int minrow, int maxrow)
|
||||||
|
|
||||||
if (af->unit->race->flags & RCF_FLY) {
|
if (af->unit->race->flags & RCF_FLY) {
|
||||||
/* flying races ignore min- and maxrow and can attack anyone fighting
|
/* flying races ignore min- and maxrow and can attack anyone fighting
|
||||||
* them */
|
* them */
|
||||||
minrow = FIGHT_ROW;
|
minrow = FIGHT_ROW;
|
||||||
maxrow = BEHIND_ROW;
|
maxrow = BEHIND_ROW;
|
||||||
}
|
}
|
||||||
minrow = max(minrow, FIGHT_ROW);
|
minrow = max(minrow, FIGHT_ROW);
|
||||||
|
|
||||||
if (dt.fighter!=NULL && dt.index<dt.fighter->alive) {
|
if (dt.fighter!=NULL && dt.index<dt.fighter->alive-dt.fighter->removed) {
|
||||||
fighter * df = dt.fighter;
|
fighter * df = dt.fighter;
|
||||||
int row = get_unitrow(df);
|
int row = get_unitrow(df);
|
||||||
if (row>=minrow && row<=maxrow) {
|
if (row>=minrow && row<=maxrow) {
|
||||||
troop ot = df->person[dt.index].opponent;
|
troop ot = df->person[dt.index].opponent;
|
||||||
if (ot.fighter==NULL || ot.index>=ot.fighter->alive) {
|
if (ot.fighter==NULL || ot.index>=ot.fighter->alive-ot.fighter->removed) {
|
||||||
df->person[dt.index].opponent = at;
|
df->person[dt.index].opponent = at;
|
||||||
}
|
}
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dt = select_enemy(b, at.fighter, minrow, maxrow);
|
dt = select_enemy(b, at.fighter, minrow, maxrow);
|
||||||
if (dt.fighter!=NULL) {
|
if (dt.fighter!=NULL) {
|
||||||
fighter * df = dt.fighter;
|
fighter * df = dt.fighter;
|
||||||
troop ot = df->person[dt.index].opponent;
|
troop ot = df->person[dt.index].opponent;
|
||||||
if (ot.fighter==NULL || ot.index>=ot.fighter->alive) {
|
if (ot.fighter==NULL || ot.index>=ot.fighter->alive-ot.fighter->removed) {
|
||||||
df->person[dt.index].opponent = at;
|
df->person[dt.index].opponent = at;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue