(att_get_combat): Fix test whether land unit exists. Closes #1034283.
(att_fight): Fix bad line break.
This commit is contained in:
parent
caac6e41ca
commit
0c8f779356
1 changed files with 4 additions and 6 deletions
|
@ -221,7 +221,7 @@ att_get_combat(struct combat *com, int isdef)
|
||||||
y = com->y;
|
y = com->y;
|
||||||
break;
|
break;
|
||||||
case EF_LAND:
|
case EF_LAND:
|
||||||
if (!getland(com->lnd_uid, &land)) {
|
if (!getland(com->lnd_uid, &land) || !land.lnd_own) {
|
||||||
if (isdef)
|
if (isdef)
|
||||||
pr("Land unit #%d is not in the same sector!\n",
|
pr("Land unit #%d is not in the same sector!\n",
|
||||||
com->lnd_uid);
|
com->lnd_uid);
|
||||||
|
@ -1969,11 +1969,9 @@ att_fight(int combat_mode, struct combat *off, struct emp_qelem *olist,
|
||||||
if (off[n].type == EF_SECTOR && off[n].mil)
|
if (off[n].type == EF_SECTOR && off[n].mil)
|
||||||
off[n].mobcost +=
|
off[n].mobcost +=
|
||||||
min(20,
|
min(20,
|
||||||
min(1,
|
off[n].mob - damage(off[n].mob,
|
||||||
off[n].mob - damage(off[n].mob,
|
100 * (a_troops[n] - off[n].troops)
|
||||||
100 * (a_troops[n] -
|
/ off[n].mil));
|
||||||
off[n].troops) /
|
|
||||||
off[n].mil)));
|
|
||||||
off[n].mil -= a_troops[n] - off[n].troops;
|
off[n].mil -= a_troops[n] - off[n].troops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue