From c0155b29085393627b764499ac4accad9032ee0a Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 3 Feb 2008 06:36:26 +0000 Subject: [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 --- crawl-ref/source/food.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'crawl-ref') 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) -- cgit v1.2.3-54-g00ecf