summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/delay.cc5
2 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index b6c372cd33..80e55b8fc9 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1458,9 +1458,10 @@ static void _input()
// XXX: Is there some smart way to avoid autoswitching back if we're
// just about to continue butchering?
- if (Options.swap_when_safe && !you.turn_is_over && player_feels_safe
+ if (!you.turn_is_over && player_feels_safe
&& you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED])
{
+ // Decrease value by 1. (0 means attribute is false, 1 = a, 2 = b, ...)
int weap = you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] - 1;
if (weap == ENDOFPACK)
weap = -1;
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 4f98fb7e85..23237b1eae 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -395,8 +395,9 @@ void stop_delay( bool stop_stair_travel )
if (Options.swap_when_safe)
{
- // XXX: This is a hack!
- // (Necessary because attributes are unsigned chars.)
+ // Use weapon slot + 1, so weapon slot 'a' (== 0) doesn't
+ // return false when checking if
+ // you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED].
you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED]
= (butcher_swap_weapon == -1 ? ENDOFPACK
: butcher_swap_weapon) + 1;