Curses: prevent spurious cursor updates
While watching a ttyrec, I noticed strange behaviour in the cursor updates; it was moved to approximately middle of the map window every so often, usually when doing ranged attacks. This wasn't really noticeable in normal gameplay, as it was moving the cursor there, and then almost immediately to where it was supposed to be. I managed to trace it down to the refresh() in curses_delay_output(). That call updates the terminal to match the ncurses stdscr window, but the stdscr window cursor position wasn't updated by NetHack.
This commit is contained in:
@@ -1068,6 +1068,7 @@ curses_delay_output(void)
|
||||
if (flags.nap && !iflags.debug_fuzzer) {
|
||||
/* refreshing the whole display is a waste of time,
|
||||
* but that's why we're here */
|
||||
curses_update_stdscr_cursor();
|
||||
refresh();
|
||||
napms(50);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user