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 */
| 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 */ |
| 2781 | void |
| 2782 | update_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 */ |
| 2813 | int |
no test coverage detected