]> granicus.if.org Git - nethack/commitdiff
flush_screen() sequencing
authorPatR <rankin@nethack.org>
Wed, 9 Feb 2022 21:02:19 +0000 (13:02 -0800)
committerPatR <rankin@nethack.org>
Wed, 9 Feb 2022 21:02:19 +0000 (13:02 -0800)
Call display_nhwindow(WIN_MAP) after curs_on_u().  Instead of calling
it a second time, it's simplest to just update status before updating
the map.

If anything is still leaving the cursor dangling at the end of status
I think it will now dangle at the last updated position on the map.

src/display.c

index adcbfca6a753749042c3762ad76d2ce3c91c354d..5a7ee14e1811d59e1a87c0a2a4bf4d7a3eabecd2 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 display.c       $NHDT-Date: 1643491545 2022/01/29 21:25:45 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.174 $ */
+/* NetHack 3.7 display.c       $NHDT-Date: 1644440006 2022/02/09 20:53:26 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.177 $ */
 /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
 /* and Dave Cohrs, 1990.                                          */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1847,6 +1847,12 @@ flush_screen(int cursor_on_u)
         return;
 #endif
 
+    /* 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();
+
     for (y = 0; y < ROWNO; y++) {
         register gbuf_entry *gptr = &g.gbuf[y][x = g.gbuf_start[y]];
 
@@ -1858,19 +1864,13 @@ flush_screen(int cursor_on_u)
                 gptr->gnew = 0;
             }
     }
-
-    display_nhwindow(WIN_MAP, FALSE);
     reset_glyph_bbox();
 
-    /* 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  */
+    /* after map update, before display_nhwindow(WIN_MAP) */
     if (cursor_on_u)
         curs(WIN_MAP, u.ux, u.uy); /* move cursor to the hero */
+
+    display_nhwindow(WIN_MAP, FALSE);
     flushing = 0;
 }