summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 00:25:36 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 00:25:36 +0000
commit9242e32cfc75a0655f5b95c636425a19045a90e5 (patch)
tree994e05e814e8076f5227a7b9e64413c5b2fa33c4 /crawl-ref/source/initfile.cc
parentdf7f0e866d3476d46f57767da6b46f1b670587ea (diff)
downloadcrawl-ref-9242e32cfc75a0655f5b95c636425a19045a90e5.tar.gz
crawl-ref-9242e32cfc75a0655f5b95c636425a19045a90e5.zip
Fix the old issue of switching to the butchering tool before actually
deciding on which corpse to butcher. Now, if there's no eligible tool to automatically switch to (or the autoswitch option is false) you get prompted at the beginning of the butchering routine but you don't actually switch weapons or take off your gloves until right before you start butchering. Obviously, the same applies when autoswitching. This means you don't lose a turn anymore if you change your mind in-between. I really hope I haven't introduced other bugs this way but a fix was badly in need since I'd changed the automatic weapon swap to take a turn just as the manual swap does. Also fix swap_when_safe so that it also working when the real weapon is on slot 'a' (== 0) which will probably be the norm rather than an exception. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6437 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 9745be3425..098db26920 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -242,14 +242,15 @@ std::string channel_to_str( int channel )
static int _str_to_book( const std::string& str )
{
- if ( str == "fire" || str == "flame" )
+ if (str == "fire" || str == "flame")
return SBT_FIRE;
- if ( str == "cold" || str == "ice" )
+ if (str == "cold" || str == "ice")
return SBT_COLD;
- if ( str == "summ" || str == "summoning" )
+ if (str == "summ" || str == "summoning")
return SBT_SUMM;
- if ( str == "random" )
+ if (str == "random")
return SBT_RANDOM;
+
return SBT_NO_SELECTION;
}
@@ -286,7 +287,6 @@ std::string weapon_to_str( int weapon )
case WPN_HAND_AXE:
return "hand axe";
case WPN_RANDOM:
- return "random";
default:
return "random";
}