blank perm_invent after repeating spell cast
add mechanics to ensure display_inventory() refreshes perm_invent as expected when update_inventory() is called from a repeat command. Resolves #1454
This commit is contained in:
@@ -799,6 +799,7 @@ struct sinfo {
|
|||||||
int in_role_selection; /* role/race/&c selection menus in progress */
|
int in_role_selection; /* role/race/&c selection menus in progress */
|
||||||
int in_getlin; /* inside interface getlin routine */
|
int in_getlin; /* inside interface getlin routine */
|
||||||
int in_sanity_check; /* for impossible() during sanity checking */
|
int in_sanity_check; /* for impossible() during sanity checking */
|
||||||
|
int in_update_inventory; /* inside update_inventory() function */
|
||||||
int config_error_ready; /* config_error_add is ready, available */
|
int config_error_ready; /* config_error_add is ready, available */
|
||||||
int beyond_savefile_load; /* set when past savefile loading */
|
int beyond_savefile_load; /* set when past savefile loading */
|
||||||
int savefile_completed; /* savefile has completed writing */
|
int savefile_completed; /* savefile has completed writing */
|
||||||
|
|||||||
+3
-1
@@ -2703,10 +2703,12 @@ update_inventory(void)
|
|||||||
* attempt in the shop code handled it for unpaid items but not for
|
* attempt in the shop code handled it for unpaid items but not for
|
||||||
* paying for used-up shop items; that follows a different code path.)
|
* paying for used-up shop items; that follows a different code path.)
|
||||||
*/
|
*/
|
||||||
|
program_state.in_update_inventory = TRUE;
|
||||||
save_suppress_price = iflags.suppress_price;
|
save_suppress_price = iflags.suppress_price;
|
||||||
iflags.suppress_price = 0;
|
iflags.suppress_price = 0;
|
||||||
(*windowprocs.win_update_inventory)(0);
|
(*windowprocs.win_update_inventory)(0);
|
||||||
iflags.suppress_price = save_suppress_price;
|
iflags.suppress_price = save_suppress_price;
|
||||||
|
program_state.in_update_inventory = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the #perminv command - call interface's persistent inventory routine */
|
/* the #perminv command - call interface's persistent inventory routine */
|
||||||
@@ -4024,7 +4026,7 @@ display_inventory(const char *lets, boolean want_reply)
|
|||||||
{
|
{
|
||||||
struct _cmd_queue *cmdq = cmdq_pop();
|
struct _cmd_queue *cmdq = cmdq_pop();
|
||||||
|
|
||||||
if (cmdq) {
|
if (cmdq && !program_state.in_update_inventory) {
|
||||||
if (cmdq->typ == CMDQ_KEY) {
|
if (cmdq->typ == CMDQ_KEY) {
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user