Fix trade ships to pay off in own harbor
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Jan 2011 20:20:28 +0000 (21:20 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Feb 2011 15:03:34 +0000 (16:03 +0100)
Broken in commit 3318e4e4, v4.3.17.

src/lib/commands/scut.c

index 0c0739cce992cccd6985e6c28a0807a6e6e6f3cc..570cb89aa6427de7d54db94c1482bd285c793efb 100644 (file)
@@ -165,7 +165,8 @@ scuttle_tradeship(struct shpstr *sp, int interactive)
     mp = &mchr[(int)sp->shp_type];
     getsect(sp->shp_x, sp->shp_y, &sect);
     if (sect.sct_own && sect.sct_type == SCT_HARBR && sect.sct_effic >= 2
-       && getrel(getnatp(sect.sct_own), sp->shp_own) >= FRIENDLY) {
+       && (sect.sct_own == sp->shp_own
+           || getrel(getnatp(sect.sct_own), sp->shp_own) >= FRIENDLY)) {
        dist = mapdist(sp->shp_x, sp->shp_y,
                       sp->shp_orig_x, sp->shp_orig_y);
        /* Don't disclose distance to to pirates */