]> granicus.if.org Git - nethack/commitdiff
a slight code-reordering in flush_screen()
authornhmall <nhmall@nethack.org>
Sat, 5 Feb 2022 19:12:18 +0000 (14:12 -0500)
committernhmall <nhmall@nethack.org>
Sat, 5 Feb 2022 19:12:18 +0000 (14:12 -0500)
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.

doc/fixes3-7-0.txt
src/display.c

index 9ccb108562b2bf8832f0d4e7dc42182c140bb904..2d603c87ae4de92d32efa702ae099f4e4cc6cf13 100644 (file)
@@ -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
index c6820470308831b79e1775ebe39fb34ed548a7b5..cff0464c00251b81905d5c8e724491b9262bc370 100644 (file)
@@ -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();
 }
 
 /* ======================================================================== */