summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd6.cc38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/cmd6.cc b/src/cmd6.cc
index 74b192f6..39d15f59 100644
--- a/src/cmd6.cc
+++ b/src/cmd6.cc
@@ -3735,15 +3735,15 @@ void do_cmd_use_staff(void)
return;
}
+ /* Enter device mode */
+ set_stick_mode(o_ptr);
+
/* Take a turn */
energy_use = 100;
/* Not identified yet */
ident = FALSE;
- /* Enter device mode */
- set_stick_mode(o_ptr);
-
/* get the chance */
int chance;
{
@@ -3751,9 +3751,6 @@ void do_cmd_use_staff(void)
chance = spell_chance_device(spell);
}
- /* Leave device mode */
- unset_stick_mode();
-
/* Extract object flags */
object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
@@ -3775,6 +3772,9 @@ void do_cmd_use_staff(void)
if (flush_failure) flush();
msg_print("You failed to use the staff properly.");
sound(SOUND_FAIL);
+
+ /* Leave device mode */
+ unset_stick_mode();
return;
}
@@ -3784,6 +3784,9 @@ void do_cmd_use_staff(void)
if (flush_failure) flush();
msg_print("The staff has no charges left.");
o_ptr->ident |= (IDENT_EMPTY);
+
+ /* Leave device mode */
+ unset_stick_mode();
return;
}
@@ -3809,6 +3812,9 @@ void do_cmd_use_staff(void)
/* Hack -- some uses are "free" */
if (!use_charge)
{
+ /* Leave device mode */
+ unset_stick_mode();
+
return;
}
@@ -3858,6 +3864,9 @@ void do_cmd_use_staff(void)
{
floor_item_charges(0 - item);
}
+
+ /* Leave device mode */
+ unset_stick_mode();
}
@@ -3940,9 +3949,6 @@ void do_cmd_aim_wand(void)
chance = spell_chance_device(spell);
}
- /* Leave device mode */
- unset_stick_mode();
-
/* Extract object flags */
object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
@@ -3958,6 +3964,9 @@ void do_cmd_aim_wand(void)
if (flush_failure) flush();
msg_print("You failed to use the wand properly.");
sound(SOUND_FAIL);
+
+ /* Leave device mode */
+ unset_stick_mode();
return;
}
@@ -3967,12 +3976,17 @@ void do_cmd_aim_wand(void)
if (flush_failure) flush();
msg_print("The wand has no charges left.");
o_ptr->ident |= (IDENT_EMPTY);
+
+ /* Leave device mode */
+ unset_stick_mode();
return;
}
+
/* Sound */
sound(SOUND_ZAP);
+
/* Analyze the wand */
activate_stick(o_ptr->pval2, &obvious, &use_charge);
@@ -3985,6 +3999,9 @@ void do_cmd_aim_wand(void)
/* Hack -- some uses are "free" */
if (!use_charge)
{
+ /* Leave device mode */
+ unset_stick_mode();
+
return;
}
@@ -4012,6 +4029,9 @@ void do_cmd_aim_wand(void)
{
floor_item_charges(0 - item);
}
+
+ /* Leave device mode */
+ unset_stick_mode();
}