summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-04 18:54:29 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-12-04 18:54:29 +0000
commitc1a3d38ca3074d348ceb231efdfa138b49de2129 (patch)
tree4cbb1810f2bc2fae6211fa229696e20fa1cc1afd
parent15b1a34950ceb8002fb3fe2f152ce6128a22782b (diff)
downloadcrawl-ref-c1a3d38ca3074d348ceb231efdfa138b49de2129.tar.gz
crawl-ref-c1a3d38ca3074d348ceb231efdfa138b49de2129.zip
[1605400] Fixed inability to wield stuff when carrying no weapons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.1.5@560 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/invent.cc3
-rw-r--r--crawl-ref/source/item_use.cc7
-rw-r--r--crawl-ref/source/menu.cc5
3 files changed, 8 insertions, 7 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 8302728722..7aa9b5c2c8 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -362,9 +362,6 @@ bool InvMenu::process_key( int key )
unsigned char InvMenu::getkey() const
{
unsigned char mkey = lastch;
- // Fake an ESCAPE if the menu is empty.
- if (!item_count())
- mkey = ESCAPE;
if (!isalnum(mkey) && mkey != '$' && mkey != '-' && mkey != '?'
&& mkey != '*' && mkey != ESCAPE)
mkey = ' ';
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index a52bdcddc6..2b77fb9440 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -177,7 +177,8 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages)
return (false);
}
- // Any general reasons why we can't wield a new object?
+ // Look for conditions like berserking that could prevent wielding
+ // weapons.
if (!can_wield(NULL, true))
return (false);
@@ -201,8 +202,8 @@ bool wield_weapon(bool auto_wield, int slot, bool show_weff_messages)
&& you.inv[item_slot].base_type != OBJ_MISSILES
&& you.inv[item_slot].base_type != OBJ_STAVES;
- // Prompt if not using the auto swap command,
- // or if the swap slot is empty.
+ // Prompt if not using the auto swap command, or if the swap slot
+ // is empty.
if (!auto_wield || !is_valid_item(you.inv[item_slot]) || force_unwield)
{
if (!auto_wield)
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index c804c5343b..05f4fa2c77 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -155,8 +155,11 @@ int Menu::post_process(int k)
bool Menu::process_key( int keyin )
{
if (items.size() == 0)
+ {
+ lastch = keyin;
return false;
-
+ }
+
bool nav = false, repaint = false;
if (f_keyfilter)