From c5887300c0f938671c78fc4a59f74ea98ac5bd04 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 6 Apr 2009 18:13:14 +0000 Subject: Fix 2726622: untransforming not prompting for safe-inscribed equipment Also, when transforming voluntarily (i.e. not via Xom or by drawing a card) you get prompted for the loss of safe-inscribed equipment. If you opt out, it costs neither turn nor mana. There's an edge case when you change from one transformation to another one: if that fails for whatever reason you lose the turn (due to untransforming) and the spell fizzles (including mana loss). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9588 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/delay.cc') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 7b1f8f0e85..5af430ddd0 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -592,7 +592,8 @@ void handle_interrupted_swap(bool swap_if_safe, bool force_unsafe, // Turn is over, set up a delay to do swapping next turn. if (prompt && yesno(prompt_str, true, 'n') || safe && swap_if_safe) { - start_delay(DELAY_WEAPON_SWAP, 1, weap); + if (weap == -1 || check_warning_inscriptions(you.inv[weap], OPER_WIELD)) + start_delay(DELAY_WEAPON_SWAP, 1, weap); you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0; } return; @@ -604,7 +605,8 @@ void handle_interrupted_swap(bool swap_if_safe, bool force_unsafe, if (_is_butcher_delay(delay) && (safe || prompt && yesno(prompt_str, true, 'n'))) { - start_delay(DELAY_WEAPON_SWAP, 1, weap); + if (weap == -1 || check_warning_inscriptions(you.inv[weap], OPER_WIELD)) + start_delay(DELAY_WEAPON_SWAP, 1, weap); you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0; } return; @@ -620,9 +622,11 @@ void handle_interrupted_swap(bool swap_if_safe, bool force_unsafe, return; } - weapon_switch(weap); - print_stats(); - + if (weap == -1 || check_warning_inscriptions(you.inv[weap], OPER_WIELD)) + { + weapon_switch(weap); + print_stats(); + } you.attribute[ATTR_WEAPON_SWAP_INTERRUPTED] = 0; } -- cgit v1.2.3-54-g00ecf