]> git.pond.sub.org Git - empserver/commitdiff
Neater plane sonar contact output
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 18 Jul 2010 08:37:43 +0000 (10:37 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Jul 2010 15:48:54 +0000 (17:48 +0200)
plane_sona() prints an empty line to make sonar contacts stand out.
Move it so the contact is visually "attached" to the right sector,
like this:

    flying over sea at 15,-3
    Sonar contact in 15,-3
    sub #3 13,-3

    flying over sea at 13,-3

Before:

    flying over sea at 15,-3

    Sonar contact in 15,-3
    sb   submarine (#3) 13,-3
    flying over sea at 13,-3

src/lib/commands/sona.c

index 1846293a353a228b319accc7f97994eb0459bc6b..f38e8a6c13439ac273ce745eb69be104629da261 100644 (file)
@@ -272,7 +272,7 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
                continue;
            add_shiplist(targ->shp_uid, head);
            if (!found) {
                continue;
            add_shiplist(targ->shp_uid, head);
            if (!found) {
-               pr("\nSonar contact in %s\n", xyas(x, y, player->cnum));
+               pr("Sonar contact in %s\n", xyas(x, y, player->cnum));
                found = 1;
            }
            if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY &&
                found = 1;
            }
            if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY &&
@@ -290,6 +290,8 @@ plane_sona(struct emp_qelem *plane_list, int x, int y,
                   xyas(targ->shp_x, targ->shp_y, player->cnum));
        }
     }
                   xyas(targ->shp_x, targ->shp_y, player->cnum));
        }
     }
+    if (found)
+       pr("\n");
 }
 
 /*
 }
 
 /*