diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-07 00:35:55 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-07 00:35:55 +0000 |
commit | 33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd (patch) | |
tree | 3c06f39f3bd808f5dab3f9d4bab07d8574d685cf /crawl-ref | |
parent | 9242e32cfc75a0655f5b95c636425a19045a90e5 (diff) | |
download | crawl-ref-33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd.tar.gz crawl-ref-33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd.zip |
Add a few comments.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6438 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 5 |
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; |