satmap: Separate and align columns in output properly

Land unit coordinates run into efficiency in output of satellite when
the y coordinate is wider than three characters.  Broken in Empire 2.
Restore the separating space.

Both ship and land unit table header aren't aligned with the table
body.  Affects recon and sweep with spy planes, and satellite.  Fix
the header.

Reported-by: William Fittge <ptkei2@gmail.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2013-05-25 19:37:22 +02:00
parent 51efb954d0
commit 48912d3c0b

View file

@ -28,7 +28,7 @@
* *
* Known contributors to this file: * Known contributors to this file:
* Steve McClure, 2000 * Steve McClure, 2000
* Markus Armbruster, 2004-2011 * Markus Armbruster, 2004-2013
*/ */
#include <config.h> #include <config.h>
@ -146,7 +146,7 @@ satmap(int x, int y, int eff, int range, int flags, int type)
if (flags & P_S) { if (flags & P_S) {
pr("Satellite ship report\n"); pr("Satellite ship report\n");
prdate(); prdate();
pr(" own shp# ship type sector eff\n"); pr(" own shp# ship type sector eff\n");
} }
while (nxtitem(&ni, &ship)) { while (nxtitem(&ni, &ship)) {
if (ship.shp_own == 0) if (ship.shp_own == 0)
@ -190,7 +190,7 @@ satmap(int x, int y, int eff, int range, int flags, int type)
if (flags & P_S) { if (flags & P_S) {
pr("Satellite unit report\n"); pr("Satellite unit report\n");
prdate(); prdate();
pr(" own lnd# unit type sector eff\n"); pr(" own lnd# unit type sector eff\n");
} }
while (nxtitem(&ni, &land)) { while (nxtitem(&ni, &land)) {
if (land.lnd_own == 0) if (land.lnd_own == 0)
@ -207,7 +207,7 @@ satmap(int x, int y, int eff, int range, int flags, int type)
pr("%4d %4d %-16.16s ", pr("%4d %4d %-16.16s ",
land.lnd_own, land.lnd_uid, land.lnd_own, land.lnd_uid,
lchr[(int)land.lnd_type].l_name); lchr[(int)land.lnd_type].l_name);
prxy("%4d,%-4d", land.lnd_x, land.lnd_y); prxy("%4d,%-4d ", land.lnd_x, land.lnd_y);
pr("%3d%%\n", land.lnd_effic); pr("%3d%%\n", land.lnd_effic);
++count; ++count;
if (opt_HIDDEN) if (opt_HIDDEN)
@ -285,7 +285,7 @@ satdisp_units(coord x, coord y)
if (mchr[(int)ship.shp_type].m_flags & M_SUB) if (mchr[(int)ship.shp_type].m_flags & M_SUB)
continue; continue;
if (first) { if (first) {
pr("\t own shp# ship type sector eff\n"); pr("\t own shp# ship type sector eff\n");
first = 0; first = 0;
} }
pr("\t%4d %4d %-16.16s %-25.25s ", pr("\t%4d %4d %-16.16s %-25.25s ",
@ -312,7 +312,7 @@ satdisp_units(coord x, coord y)
continue; continue;
if (first) { if (first) {
pr("\t own lnd# unit type sector eff\n"); pr("\t own lnd# unit type sector eff\n");
first = 0; first = 0;
} }