MCPcopy Index your code
hub / github.com/NetHack/NetHack / update_inventory

Function update_inventory

src/invent.c:2781–2810  ·  view source on GitHub ↗

persistent inventory window is maintained by interface code; 'update_inventory' used to be a macro for (*windowprocs.win_update_inventory) but the restore hackery to suppress screen updates was getting out of hand; this is now a central call point */

Source from the content-addressed store, hash-verified

2779 (*windowprocs.win_update_inventory) but the restore hackery to suppress
2780 screen updates was getting out of hand; this is now a central call point */
2781void
2782update_inventory(void)
2783{
2784 int save_suppress_price;
2785
2786 if (!program_state.in_moveloop) /* not covered by suppress_map_output */
2787 return;
2788 if (suppress_map_output()) /* despite name, used for perm_invent too */
2789 return;
2790
2791 /*
2792 * Ought to check (windowprocs.wincap & WC_PERM_INVENT) here....
2793 *
2794 * We currently don't skip this call when iflags.perm_invent is False
2795 * because curses uses that to disable a previous perm_invent window
2796 * (after toggle via 'O'; perhaps the options code should handle that).
2797 *
2798 * perm_invent might get updated while some code is avoiding price
2799 * feedback during obj name formatting for messages. Temporarily
2800 * force 'normal' formatting during the perm_invent update. (Cited
2801 * example was an update triggered by change in invent gold when
2802 * transferring some to shk during itemized billing. A previous fix
2803 * attempt in the shop code handled it for unpaid items but not for
2804 * paying for used-up shop items; that follows a different code path.)
2805 */
2806 save_suppress_price = iflags.suppress_price;
2807 iflags.suppress_price = 0;
2808 (*windowprocs.win_update_inventory)(0);
2809 iflags.suppress_price = save_suppress_price;
2810}
2811
2812/* the #perminv command - call interface's persistent inventory routine */
2813int

Callers 15

dotwoweaponFunction · 0.85
uwepgoneFunction · 0.85
uswapwepgoneFunction · 0.85
uqwepgoneFunction · 0.85
untwoweaponFunction · 0.85
chweponFunction · 0.85
optfn_booleanFunction · 0.85
handler_menu_headingsFunction · 0.85
handler_sortlootFunction · 0.85
handler_menu_colorsFunction · 0.85
finish_questFunction · 0.85
container_contentsFunction · 0.85

Calls 1

suppress_map_outputFunction · 0.85

Tested by

no test coverage detected