From a0771c770bd85d3d2e637cb1df078812d618b85c Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 9 Feb 2022 13:02:19 -0800 Subject: [PATCH] flush_screen() sequencing 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 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/display.c b/src/display.c index adcbfca6a..5a7ee14e1 100644 --- a/src/display.c +++ b/src/display.c @@ -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; } -- 2.50.1