summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-03 06:36:26 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-03 06:36:26 +0000
commitc0155b29085393627b764499ac4accad9032ee0a (patch)
tree18716cf709c68cb9249b34d17546d35ee2ab2912 /crawl-ref/source/food.cc
parent9feec84530f6d3fed659a992a58147e06257c00d (diff)
downloadcrawl-ref-c0155b29085393627b764499ac4accad9032ee0a.tar.gz
crawl-ref-c0155b29085393627b764499ac4accad9032ee0a.zip
[1883949] easy_butcher will no longer switch away from a wielded distortion weapon.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3391 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 90197b4bba..a5fb1e1ddb 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -162,6 +162,21 @@ void weapon_switch( int targ )
// Returns whether a weapon was switched.
static bool find_butchering_implement( bool fallback )
{
+ // If wielding a distortion weapon, never attempt to switch away
+ // automatically.
+ if (const item_def *wpn = you.weapon())
+ {
+ if (wpn->base_type == OBJ_WEAPONS
+ && item_type_known(*wpn)
+ && get_weapon_brand(*wpn) == SPWPN_DISTORTION)
+ {
+ mprf(MSGCH_WARN,
+ "You're wielding a weapon of distortion, will not autoswap "
+ "for butchering.");
+ return false;
+ }
+ }
+
// look for a butchering implement in your pack
for (int i = 0; i < ENDOFPACK; ++i)
{
@@ -171,7 +186,8 @@ static bool find_butchering_implement( bool fallback )
&& item_known_uncursed(you.inv[i])
&& item_type_known(you.inv[i])
&& get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION
- && !has_warning_inscription(you.inv[i], OPER_WIELD) // don't even ask
+ // don't even ask
+ && !has_warning_inscription(you.inv[i], OPER_WIELD)
&& can_wield( &you.inv[i] ))
{
mpr("Switching to a butchering implement.");
@@ -274,7 +290,8 @@ bool butchery(int which_corpse)
mpr("There isn't anything to dissect here.");
return false;
}
- else if ( !prechosen && (num_corpses > 1 || Options.always_confirm_butcher) )
+ else if ( !prechosen
+ && (num_corpses > 1 || Options.always_confirm_butcher) )
{
corpse_id = -1;
for (int o=igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link)