"You are hit by the gas spore's explosion!" (inner call, followed by)
"You are hit by the !" (outer call, possibly repeated for multiple
explosions causing multiple levels of recursion)
+if multiple bands of blank lines were squeezed out of DUMPLOG's map, spurious
+ blank lines appeared in the final map output
Platform- and/or Interface-Specific Fixes
-/* NetHack 3.6 detect.c $NHDT-Date: 1519281847 2018/02/22 06:44:07 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
+/* NetHack 3.6 detect.c $NHDT-Date: 1522891623 2018/04/05 01:27:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
void
dump_map()
{
- int x, y, glyph, skippedrows;
+ int x, y, glyph, skippedrows, lastnonblank;
int subset = TER_MAP | TER_TRP | TER_OBJ | TER_MON;
int default_glyph = cmap_to_glyph(level.flags.arboreal ? S_tree : S_stone);
char buf[BUFSZ];
toprow = TRUE;
for (y = 0; y < ROWNO; y++) {
blankrow = TRUE; /* assume blank until we discover otherwise */
+ lastnonblank = -1; /* buf[] index rather than map's x */
for (x = 1; x < COLNO; x++) {
int ch, color;
unsigned special;
- glyph = reveal_terrain_getglyph(x,y, FALSE, u.uswallow,
+ glyph = reveal_terrain_getglyph(x, y, FALSE, u.uswallow,
default_glyph, subset);
(void) mapglyph(glyph, &ch, &color, &special, x, y);
buf[x - 1] = ch;
- if (ch != ' ')
+ if (ch != ' ') {
blankrow = FALSE;
+ lastnonblank = x - 1;
+ }
}
if (!blankrow) {
- buf[x - 2] = '\0';
+ buf[lastnonblank + 1] = '\0';
if (toprow) {
skippedrows = 0;
toprow = FALSE;
for (x = 0; x < skippedrows; x++)
putstr(0, 0, "");
putstr(0, 0, buf); /* map row #y */
+ skippedrows = 0;
} else {
++skippedrows;
}