curses: interactively toggling 'perm_invent' On

Enabling perm_invent with 'O' ('m O' these days) with curses used to
work but stopped at some point.  Analysis by entrez has attributed
the change to the g.program_state.in_docrt flag in docrt().  When
curses creates the perm_invent window for update_inventory(), it
calls docrt() to have nethack redraw the screen.

 docrt() -> update_inventory() -> curses_update_inventory() -> ...
  -> curs_reset_windows() -> doredraw() -> docrt() [early return]

resulted in room for the persistent inventory window but it was
blank.

This also replaces a couple of doredraw() calls with direct calls to
docrt() (one in code that isn't used).  doredraw() implements a user
command; docrt() does the actual redrawing.
This commit is contained in:
PatR
2022-08-16 15:23:37 -07:00
parent 1900a30323
commit 5c7f2945da
3 changed files with 18 additions and 3 deletions

View File

@@ -1103,7 +1103,7 @@ curs_reset_windows(boolean redo_main, boolean redo_status)
}
if (need_redraw) {
curses_last_messages();
doredraw();
docrt();
}
}

View File

@@ -1784,7 +1784,7 @@ curses_update_stats(void)
if (cy != ay) {
curses_create_main_windows();
curses_last_messages();
doredraw();
docrt();
/* Reset XP highlight (since classic_status and new show
different numbers) */