]> git.pond.sub.org Git - empserver/commitdiff
load: Drop dead recomputation of load_spy
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 1 May 2018 08:03:30 +0000 (10:03 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 06:25:18 +0000 (07:25 +0100)
load_land_ship() recomputes load_spy "since [the carrier] may have
changed".  Has been that way since the feature was added in 4.2.0, but
it's nonsense.  Drop it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/load.c

index 912582e5ec213b1459d026abb70ca158a8c23de6..d6d5ab94671e17b3dd6bdf42cdb33eb9d1bc0f1e 100644 (file)
@@ -589,21 +589,18 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
        }
        /* Fit unit on ship */
        if (loading) {
-           /* We have to check again, since it may have changed */
-           if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
-               (mchr[(int)sp->shp_type].m_nland == 0)) {
+           if (load_spy) {
                if (shp_nland(sp) >= 2) {
                    pr("Non-land unit carrying subs can only carry up to two spy units.\n");
                    return 0;
                }
-               /* Eh, let 'em load a spy only */
-               load_spy = 1;
-           }
-           if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
-               if (noisy)
-                   pr("%s doesn't have room for any more land units!\n",
-                      prship(sp));
-               return 0;
+           } else {
+               if (shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
+                   if (noisy)
+                       pr("%s doesn't have room for any more land units!\n",
+                          prship(sp));
+                   return 0;
+               }
            }
            sprintf(buf, "loaded on your %s at %s",
                    prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));