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.
This commit is contained in:
nhmall
2022-02-05 14:12:18 -05:00
parent ea2e61aba0
commit 99cdb8bfb5
2 changed files with 10 additions and 5 deletions

View 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();
}
/* ======================================================================== */