]> git.pond.sub.org Git - empserver/commitdiff
Fix when scuttle_tradeship() asks for confirmation
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 13 Sep 2008 21:07:15 +0000 (17:07 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 15 Sep 2008 22:48:33 +0000 (18:48 -0400)
Fix scuttle to ask for confirmation when scuttling a tradeship in an
unsuitable sector even when the tradeship is pirated.  Broken when
commit a99bc3be (v4.2.13) suppressed that for pirated tradeships
wholesale because it let pirates ferret out where the ship was built.

src/lib/commands/scut.c

index deb04d5e3a4b3ae9dbe28c34718ef398e2e15f0e..0446ed7f526e02d4160a36908cf4c67f080f85a6 100644 (file)
@@ -156,7 +156,7 @@ scuttle_tradeship(struct shpstr *sp, int interactive)
 {
     float cash = 0;
     float ally_cash = 0;
 {
     float cash = 0;
     float ally_cash = 0;
-    int dist;
+    int dist = -1;
     struct sctstr sect;
     struct mchrstr *mp;
     struct natstr *np;
     struct sctstr sect;
     struct mchrstr *mp;
     struct natstr *np;
@@ -202,7 +202,7 @@ scuttle_tradeship(struct shpstr *sp, int interactive)
        wu(0, sp->shp_own, "Unfortunately, you make $0 on this trade.\n");
     } else if (cash && interactive) {
        player->dolcost -= cash;
        wu(0, sp->shp_own, "Unfortunately, you make $0 on this trade.\n");
     } else if (cash && interactive) {
        player->dolcost -= cash;
-    } else if (interactive && sp->shp_own == sp->shp_orig_own) {
+    } else if (interactive && (dist < 0 || sp->shp_own == sp->shp_orig_own)) {
        pr("You won't get any money if you scuttle in %s!",
           xyas(sp->shp_x, sp->shp_y, player->cnum));
        sprintf(buf, "Are you sure you want to scuttle %s? ", prship(sp));
        pr("You won't get any money if you scuttle in %s!",
           xyas(sp->shp_x, sp->shp_y, player->cnum));
        sprintf(buf, "Are you sure you want to scuttle %s? ", prship(sp));