From: PatR Date: Wed, 18 May 2016 23:36:18 +0000 (-0700) Subject: fix #H4343 - obscure tty bug while swallowed X-Git-Tag: NetHack-3.6.1_RC01~764 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fccd29dfd46f6b8f93d36d19cd9dc7fb4b7c9ade;p=nethack fix #H4343 - obscure tty bug while swallowed When --More-- was written to leftmost column of line 2 while the hero was swallowed, after player acknowledged it and the top line was cleared, the cursor ended up in the wrong place. I still don't understand what in the world is going on here, but adding 'flush_screen(0)' after 'swallowed(1)' in docorner() makes the problem go away. Why is the behavior different when --More-- is in the first column than when it's anywhere else? After that fix, I commented the whole thing out. The swallowed optimization is just not significant enough to justify peeking at core internals. Core bit: prior to those two changes, I tried inserting 'bot()' into swallowed(). It moved the mis-positioned cursor from the end of the second status line to on the map just right of the bottom right corner of the swallowed display. That didn't fix anything, but I've left it in place. bot() to update status is needed following cls(); now it happens before redrawing the map instead of at some point after. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 807ea38e3..5759146aa 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -294,6 +294,9 @@ tty: skip selector letter and selection indicator (-,+,#) during menu coloring tty: '>' no longer closes a menu window tty: if color is disabled and use_inverse is enabled, display lava in inverse video so that it is visually distinguishable from water +tty: if "--More--" was written to leftmost column (beginning of second line) + while hero was swallowed, cursor would end up in wrong place (at end + of status line instead back on map) after message line was cleared unix/X11: in top level Makefile, some commented out definitions of VARDATND misspelled pilemark.xbm (as pilemark.xpm) unix: options file with CR+LF line ends and an invalid option line resulted in diff --git a/src/display.c b/src/display.c index 235de6c36..d3a4e50ae 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 display.c $NHDT-Date: 1463154502 2016/05/13 15:48:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.85 $ */ +/* NetHack 3.6 display.c $NHDT-Date: 1463614572 2016/05/18 23:36:12 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.86 $ */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* and Dave Cohrs, 1990. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1009,9 +1009,10 @@ int first; static xchar lastx, lasty; /* last swallowed position */ int swallower, left_ok, rght_ok; - if (first) + if (first) { cls(); - else { + bot(); + } else { register int x, y; /* Clear old location */ diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 38fd61749..ed7eefd23 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 wintty.c $NHDT-Date: 1461619522 2016/04/25 21:25:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.130 $ */ +/* NetHack 3.6 wintty.c $NHDT-Date: 1463614572 2016/05/18 23:36:12 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.131 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -3027,10 +3027,17 @@ register int xmin, ymax; register int y; register struct WinDesc *cw = wins[WIN_MAP]; +#if 0 /* this optimization is not valuable enough to justify + abusing core internals... */ if (u.uswallow) { /* Can be done more efficiently */ swallowed(1); + /* without this flush, if we happen to follow --More-- displayed in + leftmost column, the cursor gets left in the wrong place after + LI)