#include "angband.h"
#include "util.h"
+#include "main/sound-definitions-table.h"
-#include "player-race.h"
+#include "player/player-race.h"
#include "spells-summon.h"
#include "avatar.h"
-#include "player-status.h"
-#include "player-effects.h"
-#include "player-class.h"
+#include "player/player-status.h"
+#include "player/player-effects.h"
+#include "player/player-class.h"
#include "player-inventory.h"
-#include "spells.h"
+#include "spell/spells2.h"
+#include "spell/spells3.h"
#include "spells-status.h"
#include "spells-floor.h"
-#include "object-hook.h"
+#include "object/object-hook.h"
#include "cmd-basic.h"
-#include "floor.h"
-#include "objectkind.h"
-#include "view-mainwindow.h"
+#include "floor/floor.h"
+#include "object/object-kind.h"
+#include "view/display-main-window.h"
/*!
case SV_STAFF_IDENTIFY:
{
if (powerful) {
- if (!identify_fully(creature_ptr, FALSE)) *use_charge = FALSE;
+ if (!identify_fully(creature_ptr, FALSE, 0)) *use_charge = FALSE;
}
else {
- if (!ident_spell(creature_ptr, FALSE)) *use_charge = FALSE;
+ if (!ident_spell(creature_ptr, FALSE, 0)) *use_charge = FALSE;
}
ident = TRUE;
break;
chg_virtue(creature_ptr, V_CHANCE, 1);
chg_virtue(creature_ptr, V_KNOWLEDGE, -1);
}
- creature_ptr->update |= (PU_COMBINE | PU_REORDER);
+
+ /*
+ * Temporarily remove the flags for updating the inventory so
+ * gain_exp() does not reorder the inventory before the charge
+ * is deducted from the staff.
+ */
+ BIT_FLAGS inventory_flags = (PU_COMBINE | PU_REORDER | (creature_ptr->update & PU_AUTODESTROY));
+ creature_ptr->update &= ~(PU_COMBINE | PU_REORDER | PU_AUTODESTROY);
/* Tried the item */
object_tried(o_ptr);
}
creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
-
+ creature_ptr->update |= inventory_flags;
/* Hack -- some uses are "free" */
if (!use_charge) return;