From 9555f782913d3cf3ab1e57a3280a6a0439df9154 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 15 Jul 2008 22:25:11 +0000 Subject: Fix Evaporate prompt doing the opposite of the player's answer. Fix some more instances of crashes resulting from PROMPT_NOTHING. Change shadow dragon corpse type to rotting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6569 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 88f6d9cb23..9fc7428131 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -798,7 +798,7 @@ bool armour_prompt( const std::string & mesg, int *index, operation_types oper) } return (succeeded); -} // end armour_prompt() +} static bool cloak_is_being_removed( void ) { @@ -3158,8 +3158,8 @@ bool puton_ring(int slot, bool prompt_finger) else { item_slot = prompt_invent_item( "Put on which piece of jewellery?", - MT_INVLIST, OBJ_JEWELLERY, true, true, true, 0, -1, - NULL, OPER_PUTON ); + MT_INVLIST, OBJ_JEWELLERY, true, true, + true, 0, -1, NULL, OPER_PUTON ); } if (prompt_failed(item_slot)) @@ -3304,10 +3304,10 @@ bool remove_ring(int slot, bool announce) if (hand_used == EQ_NONE) { const int equipn = - (slot == -1)? prompt_invent_item( "Remove which piece of jewellery?", - MT_INVLIST, - OBJ_JEWELLERY, true, true, true, - 0, -1, NULL, OPER_REMOVE) + (slot == -1)? prompt_invent_item("Remove which piece of jewellery?", + MT_INVLIST, + OBJ_JEWELLERY, true, true, true, + 0, -1, NULL, OPER_REMOVE) : slot; if (prompt_failed(equipn)) @@ -3593,6 +3593,7 @@ void prompt_inscribe_item() } item_slot = prompt_invent_item("Inscribe which item? ", MT_INVLIST, OSEL_ANY ); + if (prompt_failed(item_slot)) return; @@ -4101,12 +4102,8 @@ static bool _handle_enchant_armour( int item_slot ) OSEL_ENCH_ARM, true, true, false ); } - if (item_slot == PROMPT_ABORT || item_slot == PROMPT_NOTHING) - { - if (item_slot == PROMPT_ABORT) - canned_msg( MSG_OK ); + if (prompt_failed(item_slot)) return (false); - } item_def& arm(you.inv[item_slot]); -- cgit v1.2.3-54-g00ecf