diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-06 18:13:14 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-06 18:13:14 +0000 |
commit | c5887300c0f938671c78fc4a59f74ea98ac5bd04 (patch) | |
tree | 0aa4af54b9bf23b76fbba657c8d04633ac71118e /crawl-ref/source/delay.cc | |
parent | acd89a148d572cedafcf498496df2d3ce42a6980 (diff) | |
download | crawl-ref-c5887300c0f938671c78fc4a59f74ea98ac5bd04.tar.gz crawl-ref-c5887300c0f938671c78fc4a59f74ea98ac5bd04.zip |
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
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 14 |
1 files changed, 9 insertions, 5 deletions
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; } |