sorder: Widen coordinate columns to four characters

When formatting coordinates for fixed-width output, the width should
be at least four characters.

Columns x,y, start and end use three.  Has always been that way,
except for end, which used two until commit e07fb30 (v4.2.13).

Widen them all to four.  This cleans up output for world sizes between
200 and 1998.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2013-05-26 10:58:23 +02:00
parent adc66a65a6
commit 3e7542a9ab

View file

@ -397,27 +397,26 @@ sorde(void)
if (!nships) { /* 1st ship, print banner */
if (player->god)
pr("own ");
pr("shp# ship type x,y ");
pr("start end ");
pr("len eta\n");
pr("shp# ship type x,y start end "
" len eta\n");
}
nships++;
if (player->god)
pr("%3d ", ship.shp_own);
pr("%4d", nb.cur);
pr(" %-16.16s", mchr[(int)ship.shp_type].m_name);
prxy(" %3d,%-3d", ship.shp_x, ship.shp_y);
prxy(" %4d,%-4d", ship.shp_x, ship.shp_y);
if (ship.shp_autonav & AN_AUTONAV) {
/* Destination 1 */
prxy(" %3d,%-3d", ship.shp_destx[1], ship.shp_desty[1]);
prxy(" %4d,%-4d", ship.shp_destx[1], ship.shp_desty[1]);
/* Destination 2 */
if ((ship.shp_destx[1] != ship.shp_destx[0])
|| (ship.shp_desty[1] != ship.shp_desty[0])) {
prxy(" %3d,%-3d", ship.shp_destx[0], ship.shp_desty[0]);
prxy(" %4d,%-4d", ship.shp_destx[0], ship.shp_desty[0]);
} else
pr(" ");
pr(" ");
if (ship.shp_autonav & AN_STANDBY)
pr(" suspended");