]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/trad.c
Don't write garbage to unused trade destination in trade file
[empserver] / src / lib / commands / trad.c
index 64d0aed8b1f280d034f6b7f89f061bc9edecec56..6d22dab8f97e1e6d274d3cbc7fa7b42f72dee90d 100644 (file)
@@ -177,11 +177,8 @@ trad(void)
        }
     }
     canspend = natp->nat_money - tally;
-    /*
-     * Find the destination sector for the plane before the trade is
-     * actually made, except for satellites in orbit.  Must be owned
-     * and must be a 60% airfield (except for VTOL planes).
-     */
+
+    /* Find the destination sector for the trade */
     if (((trade.trd_type == EF_PLANE) && !pln_is_in_orbit(&tg.plane))
        || (trade.trd_type == EF_NUKE)) {
        while (1) {
@@ -211,8 +208,7 @@ trad(void)
            }
            break;
        }
-    }
-    if (trade.trd_type == EF_LAND) {
+    } else if (trade.trd_type == EF_LAND) {
        while (1) {
            p = getstring("Destination sector: ", buf);
            if (!trade_check_ok(&trade, &tg))
@@ -238,6 +234,10 @@ trad(void)
            }
            break;
        }
+    } else {
+       /* This trade doesn't teleport; make destination invalid */
+       sx = 1;
+       sy = 0;
     }
 
     p = getstring("How much do you bid: ", buf);