]> git.pond.sub.org Git - empserver/commitdiff
(att_get_combat): Fix test whether land unit exists. Closes #1034283.
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 1 Oct 2005 16:39:41 +0000 (16:39 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 1 Oct 2005 16:39:41 +0000 (16:39 +0000)
(att_fight): Fix bad line break.

src/lib/subs/attsub.c

index e20b8d495d9098328e8a3b3589a46b427ed6b7d9..12c92cbbb8c5b952bab76ad67a6446692b04f881 100644 (file)
@@ -221,7 +221,7 @@ att_get_combat(struct combat *com, int isdef)
        y = com->y;
        break;
     case EF_LAND:
-       if (!getland(com->lnd_uid, &land)) {
+       if (!getland(com->lnd_uid, &land) || !land.lnd_own) {
            if (isdef)
                pr("Land unit #%d is not in the same sector!\n",
                   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)
                off[n].mobcost +=
                    min(20,
-                       min(1,
-                           off[n].mob - damage(off[n].mob,
-                                               100 * (a_troops[n] -
-                                                      off[n].troops) /
-                                               off[n].mil)));
+                       off[n].mob - damage(off[n].mob,
+                                           100 * (a_troops[n] - off[n].troops)
+                                           / off[n].mil));
            off[n].mil -= a_troops[n] - off[n].troops;
        }