From: nhmall Date: Sat, 5 Feb 2022 19:12:18 +0000 (-0500) Subject: a slight code-reordering in flush_screen() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99cdb8bfb5a62c6831ddbfce74c1d72ab6f83fde;p=nethack a slight code-reordering in flush_screen() despite flush_screen() being called with a True argument signifying that the cursor was to be left on the hero, sometimes the cursor wasn't. That was confirmed through some debug tracing and discussion. The subsequent bot() and timebot() calls could leave the cursor in the status area (on tty at least), and that was particularly observable during some runmodes. Get the bot() and timebot() calls out of the way ahead of the cursor placement call to the window port. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 9ccb10856..2d603c87a 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -767,8 +767,10 @@ covetous monsters will teleport to downstairs or upstairs to heal have fake player monsters use verbalize instead of pline when reacting to chat fix mention_walls distinguishing unseen walls from solid stone don't push unknown boulders when moving +in flush_screen, reorder the code slightly to complete the bot() and +timebot() calls prior to the window port call to place the cursor on the hero - + Fixes to 3.7.0-x Problems that Were Exposed Via git Repository ------------------------------------------------------------------ fix compile when DLB isn't defined diff --git a/src/display.c b/src/display.c index c68204703..cff0464c0 100644 --- a/src/display.c +++ b/src/display.c @@ -1859,15 +1859,18 @@ flush_screen(int cursor_on_u) } } + /* get this done now, before we place the cursor on the hero */ + if (g.context.botl || g.context.botlx) + bot(); + else if (iflags.time_botl) + timebot(); + + /* This needs to be the final thing done in flush_screen */ if (cursor_on_u) curs(WIN_MAP, u.ux, u.uy); /* move cursor to the hero */ display_nhwindow(WIN_MAP, FALSE); reset_glyph_bbox(); flushing = 0; - if (g.context.botl || g.context.botlx) - bot(); - else if (iflags.time_botl) - timebot(); } /* ======================================================================== */