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
HHTFZV7UCVSE332T2FMAS2UHWSP6OZ2PSLEJ7D47QTSBTFTUFTNAC S34LKQDIQJLIWVIPASOJBBZ6ZCXDHP5KPS7TRBZJSCDRVNCLK6UAC BZIUKX6D2YDH4PCSNOAB3VA6CVE73IJEMQWDB6RKDRGL5AKCDOFAC P2ZCF3BBG523ZEOD6XQA4X5YEHBTWH3IM33YVHXP2SQ5POXZIH4QC YCL3W2PFE6ILTGBFODCSXNPDIA46KVSZP2TI7HDMYAOEJT65RIEAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC ENOQQ6DEA6ECRNTBGYYNK7G3DFEILMKQBNKP4SUQIZW2L6HWVR7QC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC 74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC ARVJY7XPMCHI4IAQMD2VUWTAXQLCRNVSM2MK3YT4S4WHQYFTLEMAC RQR4PTMGQLTRWLYRU3KXIIDGND7FBORESJWMWFVD3WYU5SISZXAAC GKA3ZGZ2P6F22FDNSYNQDMCS3N7HNZD5QCOSQ6VJRAU2K5U4YYTQC Q5YUZONIIPGRWOIQNL6DHRGLKF4V3K5XSZCBH2SL7DP4WPLDNOSQC UET576SVCGS2TXEDRTO7BUTOTLJ77MYHIVZJCDWGH2BAXYMKG6DAC JCWJWGMQIKQGSSFJUQRKNIWW3HBOJSHYDTOPPE5BWOJTIJTDYUTAC 57E4T664CXRFPVW2BZBYI33UIHFS4PSEZURZYPSYSZK5DRLJJ5CQC UVJBHQ5KGUIEFRHKTYQPKSXYDUDKTRAXINUXGJJJ6QGNCR6JO7ZAC OFH2B2UZBK43QLFQBZ54FOCFLFNE54BZVDNCEUGDTBCUGNVZULIQC QXD3HX6QQ37PW6HVKIIKGFLO2ACROLUGKK66KFX7ED6SO4FDXB2AC 7Q4H6B62UZACQOUDHCHPMPBYEBXM5GVQINIHVHM4KLRENSH6VGTAC U6Q43EFKHJIDBBWN6RUTOYRHHX4IT73OPBR4CWIOKUDGTCYQE5PAC BINKDWGFGUPTOA7IE5KK4ZIELGU5WC3X47MYXOWU4X43EGAC5DUAC QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC VIHJ3Z75JN7BXWNOPWV3CWQZEA7K5DK36EKHCYMZC7SOSJYH2XHQC QRD2M37AMG76CPGCALZQ3N2PZ3OZ3MFETMVAEHBJJVVH2BCPVGUAC EHP6PYCIPYQ3KF4JFGBTZXEUQHN3FVAH4NUWEOWDDNKGPYVOTOJQC P25D567E2UEAQHNI7LAZPNY7KAI3J4OE77YKLWOIEEALC5RREJHAC mpr("Switching to a butchering implement.");wield_weapon( true, i, false );return (true);
if (Options.easy_butcher&& item_known_uncursed(you.inv[i])&& item_type_known(you.inv[i])&& get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION// Don't even ask!&& !has_warning_inscription(you.inv[i], OPER_WIELD)){butcher_tool = i;return (true);}elsepotential_candidate = true;
// If we didn't swap above, then we still can't cut...let's call// wield_weapon() in the "prompt the user" way...
if (you.has_claws()|| transform_can_butcher_barehanded(static_cast<transformation_type>(you.attribute[ATTR_TRANSFORMATION]))){butcher_tool = -1;return (true);}else{mpr("You can't butcher without a weapon!");return (false);}}else if (item_slot == you.equip[EQ_WEAPON]){mpr("You are already wielding that!");return (false);}
// Prompt for new weapon.mpr("What would you like to use?", MSGCH_PROMPT);wield_weapon( false );
if (is_valid_item( you.inv[item_slot] )&& you.inv[item_slot].base_type == OBJ_WEAPONS&& can_cut_meat( you.inv[item_slot] )&& can_wield( &you.inv[item_slot] )){butcher_tool = item_slot;return (true);}
// still can't butcher. Early outif ( you.weapon() == NULL ){if (you.equip[EQ_GLOVES] == -1)mpr("What, with your bare hands?");elsempr("Your gloves aren't that sharp!");}elsempr("Maybe you should try using a sharper implement.");
mprf("Switching to %s.",(butchering_tool == -1) ? "unarmed": "a butchering implement");
if (wpn_switch){new_cursed = ( you.weapon() != NULL&& you.weapon()->base_type == OBJ_WEAPONS&& item_cursed(*you.weapon()) );}
if (butcher_tool == -1 && gloved_butcher)removed_gloves = true;if (you.equip[EQ_WEAPON] != butcher_tool)wpn_switch = true;
&& weapon && weapon->base_type != OBJ_STAVES&& (weapon->base_type != OBJ_WEAPONS || is_range_weapon(*weapon))|| you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED])
&& (weapon && weapon->base_type != OBJ_STAVES&& (weapon->base_type != OBJ_WEAPONS || is_range_weapon(*weapon))|| you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED]))