diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-15 13:45:52 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-15 13:45:52 +0000 |
commit | caf27fb755b20d52479d033582a6b368eba66608 (patch) | |
tree | c9e63f0593f8bf18b832b085582de93f9270e423 /crawl-ref/source/food.cc | |
parent | 9238257d62cb6c167f91e9d9cf60dd7fa229c040 (diff) | |
download | crawl-ref-caf27fb755b20d52479d033582a6b368eba66608.tar.gz crawl-ref-caf27fb755b20d52479d033582a6b368eba66608.zip |
Fix gloved butchery, using part of evktalo's patch plus a minor hack to
ensure that the gloves are removed exactly when they should be.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10224 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index ce71b5caa3..e056390a20 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -319,17 +319,22 @@ static bool _prepare_butchery(bool can_butcher, bool removed_gloves, if (can_butcher) return (true); - // At least one of these has to be true, else what are we doing here? + // At least one of these has to be true, else what are we doing + // here? ASSERT(removed_gloves || wpn_switch); // If you can butcher by taking off your gloves, don't prompt. if (removed_gloves) { - // Actually take off the gloves; this creates a - // delay. We assume later on that gloves have a 1-turn - // takeoff delay! + // Actually take off the gloves; this creates a delay. We + // assume later on that gloves have a 1-turn takeoff delay! if (!takeoff_armour(you.equip[EQ_GLOVES])) return (false); + + // Ensure that the gloves are taken off by now by finishing the + // DELAY_ARMOUR_OFF delay started by takeoff_armour() above. + // FIXME: get rid of this hack! + finish_last_delay(); } if (wpn_switch) @@ -558,8 +563,11 @@ bool butchery(int which_corpse) if (!can_butcher) { // Try to find a butchering implement. - if (!_find_butchering_implement(butcher_tool)) - return (false); + if (!gloved_butcher) + { + if (!_find_butchering_implement(butcher_tool)) + return (false); + } if (butcher_tool == -1 && gloved_butcher) removed_gloves = true; |