]> git.pond.sub.org Git - empserver/commitdiff
navigate: Don't disclose whether unfriendly canal is navigable
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 28 Dec 2014 21:43:47 +0000 (22:43 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:15 +0000 (16:13 +0100)
When you try to navigate a ship without canal capability into an
unfriendly canal, you get "can't go" when it's below 2%, else "too
large to fit".  Always report "can't go" for unfriendly sectors.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/shpsub.c
tests/navi-march/01-navigate-1
tests/navi-march/journal.log

index b343951f8a857bf1d9541dd95de88ed09655b6ee..cabe59d13c22999ca743718b48a9761b793c1a79 100644 (file)
@@ -793,7 +793,9 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor)
        if (stuck != SHP_STUCK_NOT ||
            (sect.sct_own
             && relations_with(sect.sct_own, actor) < FRIENDLY)) {
-           if (stuck == SHP_STUCK_CANAL)
+           if (stuck == SHP_STUCK_CANAL &&
+               (!sect.sct_own
+                || relations_with(sect.sct_own, actor) >= FRIENDLY))
                sprintf(dp,
                        "is too large to fit into the canal system at %s",
                        xyas(newx, newy, actor));
index f9ae3e9fde8eb10aa8d3c00bc38b8c37c9d97886..a1da271958378e3cf36c4683480933033ae75f7a 100644 (file)
@@ -63,7 +63,6 @@ h
 | enter unfriendly canal -10,2
 navi 65 bX
 h
-| BUG: reports "too large"
 | enter unowned bridge 10,0, friendly -6,0, unfriendly bridge -10,0
 navi 70 gh
 navi 71 gh
index c3cca2c950cecaad1cd9c0a58af54af8772d07f4..d325f0f38e17aeabe638a38de6d491169a80abf8 100644 (file)
     Play#1 input navi 65 bX
     Play#1 command navigate
     Play#1 output Play#1 1 Flagship is cs   cargo ship (#65)
-    Play#1 output Play#1 1 is too large to fit into the canal system at -10,2
+    Play#1 output Play#1 1 can't go to -10,2
     Play#1 output Play#1 1  = .
     Play#1 output Play#1 1 h h h
     Play#1 output Play#1 1  c c