]> git.pond.sub.org Git - empserver/commitdiff
subs: Normalize checks whether a ship just read exists
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jul 2016 08:23:20 +0000 (10:23 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:18 +0000 (20:09 +0200)
A ship just read from the ship file exists unless its owner is zero.
Check that instead of whether efficiency is below minimum.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/attsub.c
src/lib/subs/plnsub.c

index e0c7498e55b0086ed79e03e2a30783974076175b..5b9ba9de84c35d2d5e20971c4e6254111ea18c98 100644 (file)
@@ -958,7 +958,7 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
     while (nxtitem(&ni, &land)) {
        if (land.lnd_own != player->cnum)
            continue;
-       if (land.lnd_effic < LAND_MINEFF)
+       if (!land.lnd_own)
            continue;
        if (land_answer[(int)land.lnd_army] == 'N')
            continue;
index 9bbeaad94644ba6d4e53d16a6d84825ec9a2aba7..d00fe9ae31df419acf54a17cc2c7e5838dc171f1 100644 (file)
@@ -826,7 +826,7 @@ pln_put1(struct plist *plp)
        /* We should do more, like make sure it's really
           a carrier, etc. but for now just make sure it's
           not sunk. */
-       if (ship.shp_effic < SHIP_MINEFF) {
+       if (!ship.shp_own) {
            mpr(pp->pln_own,
                "Ship #%d has been sunk, plane #%d has nowhere to land, and\n"
                "splashes into the sea.\n",