diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-11 16:29:05 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-11 16:29:05 +0000 |
commit | 53a915ae2eef1b5c39147e2ccaf6695b2e995898 (patch) | |
tree | b1f1005a30b0e161427a5f8ec802a0fa57e0d74a /crawl-ref/source/it_use2.cc | |
parent | 0bca2a20b6a35b2f3be34fab88902866ae7c38c6 (diff) | |
download | crawl-ref-53a915ae2eef1b5c39147e2ccaf6695b2e995898.tar.gz crawl-ref-53a915ae2eef1b5c39147e2ccaf6695b2e995898.zip |
Implementing FR 1829063: warning when putting on/removing items
with a stat property that will be fatal.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2839 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/it_use2.cc')
-rw-r--r-- | crawl-ref/source/it_use2.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 2d88e96d3d..6eeb4ac953 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -27,6 +27,7 @@ #include "beam.h" #include "effects.h" #include "food.h" +#include "item_use.h" #include "itemname.h" #include "itemprop.h" #include "misc.h" @@ -365,12 +366,15 @@ bool potion_effect( potion_type pot_eff, int pow ) return (effect); } // end potion_effect() -void unwield_item(bool showMsgs) +bool unwield_item(bool showMsgs) { const int unw = you.equip[EQ_WEAPON]; if ( unw == -1 ) - return; + return (false); + if (!safe_to_remove_or_wear(you.inv[unw], true)) + return (false); + you.equip[EQ_WEAPON] = -1; you.special_wield = SPWLD_NONE; you.wield_change = true; @@ -413,7 +417,7 @@ void unwield_item(bool showMsgs) break; } - return; + return (true); } const int brand = get_weapon_brand( item ); @@ -498,7 +502,7 @@ void unwield_item(bool showMsgs) mpr("You fell your mana capacity decrease."); } - return; + return (true); } // end unwield_item() // This does *not* call ev_mod! |