From 33dc7cedd5a65d3bd1ce8eff9006e4517a3390dd Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 7 Jul 2008 00:35:55 +0000 Subject: Add a few comments. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6438 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 3 ++- crawl-ref/source/delay.cc | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'crawl-ref') 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; -- cgit v1.2.3-54-g00ecf