From: PatR Date: Wed, 1 Apr 2020 22:49:28 +0000 (-0700) Subject: partial fix for S_unexplored X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49f4a1d8d2e4233a1fe6623c62cc17cd775246b2;p=nethack partial fix for S_unexplored I've been sitting on this for a while but have decided that I'm not likely to make any further progress. SYMBOLS=S_stone:8,S_unexplored:9 on tty reveals that S_stone works as intended but S_unexplored does not. Unexplored was being drawn as spaces, and detected or sensed monsters moving around unexplored areas left a trail of S_unexplored characters behind them. ^R reverted those to spaces. This is only a partial fix that works when the map is initially drawn or fully redrawn. But after tty erases parts of lines (when deleting a menu that overlaid the map or when clearing a message line that wrapped onto the top line of the map), unexplored locations show up as space rather than as S_unexplored. --- diff --git a/src/display.c b/src/display.c index 30711647b..b9abb33e2 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 display.c $NHDT-Date: 1583195581 2020/03/03 00:33:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.127 $ */ +/* NetHack 3.6 display.c $NHDT-Date: 1585781359 2020/04/01 22:49:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.128 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1501,7 +1501,7 @@ void newsym_force(x, y) register int x, y; { - newsym(x,y); + newsym(x, y); g.gbuf[y][x].gnew = 1; if (g.gbuf_start[y] > x) g.gbuf_start[y] = x; @@ -1642,8 +1642,8 @@ int start, stop, y; void cls() { - int y; static boolean in_cls = 0; + int y, x, force_unexplored; if (in_cls) return; @@ -1653,9 +1653,14 @@ cls() clear_nhwindow(WIN_MAP); /* clear physical screen */ clear_glyph_buffer(); /* this is sort of an extra effort, but OK */ + force_unexplored = (g.showsyms[SYM_UNEXPLORED + SYM_OFF_X] != ' '); for (y = 0; y < ROWNO; y++) { - g.gbuf_start[y] = 0; + g.gbuf_start[y] = 1; g.gbuf_stop[y] = COLNO - 1; + if (force_unexplored) { + for (x = 1; x < COLNO; x++) + g.gbuf[y][x].gnew = 1; + } } in_cls = FALSE; }