diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-03 13:55:43 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-03 13:55:43 +0000 |
commit | 7a242f8e4ab1ab615cadcbf280de0ddd99754b0a (patch) | |
tree | 003089e0ce290ec32c64162bfe9b49799ee8d3ce /crawl-ref/source/food.cc | |
parent | 240d2022a003e137a8f32e7dd8985e8cb2871f8b (diff) | |
download | crawl-ref-7a242f8e4ab1ab615cadcbf280de0ddd99754b0a.tar.gz crawl-ref-7a242f8e4ab1ab615cadcbf280de0ddd99754b0a.zip |
Fix a bug with swap_when_safe, and experimentally default
chunks_autopickup, swap_when_safe, and show_beam to true.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5457 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 16e4271503..f030f9af06 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -132,15 +132,27 @@ void set_hunger( int new_hunger_level, bool suppress_msg ) // More of a "weapon_switch back from butchering" function, switching // to a weapon is done using the wield_weapon code. // special cases like staves of power or other special weps are taken -// care of by calling wield_effects() {gdl} +// care of by calling wield_effects(). {gdl} void weapon_switch( int targ ) { - if (targ == -1) + if (targ == -1) // Unarmed Combat. { + // Already unarmed? + if (you.equip[EQ_WEAPON] == -1) + return; + mpr( "You switch back to your bare hands." ); } else { + // Possibly not valid anymore (dropped etc.) + if (!is_valid_item(you.inv[targ])) + return; + + // Already wielding this weapon? + if (you.equip[EQ_WEAPON] == you.inv[targ].link) + return; + mprf("Switching back to %s.", you.inv[targ].name(DESC_INVENTORY).c_str()); } |