summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-13 03:54:21 -0400
committerNeil Moore <neil@s-z.org>2014-07-13 03:54:21 -0400
commitd84d17faf47ffe97b2ee71723d59e8afc03c8e65 (patch)
tree3613a467c4f509e81cc507e36712f9f1a2ceb0f4 /crawl-ref/source/itemprop.cc
parent8d519bde221ecfd61149a0282e43be514a4515cd (diff)
downloadcrawl-ref-d84d17faf47ffe97b2ee71723d59e8afc03c8e65.tar.gz
crawl-ref-d84d17faf47ffe97b2ee71723d59e8afc03c8e65.zip
Don't crash when wielding non-weapons with a shield.
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 43f6cf1f6a..065cf8d333 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1292,15 +1292,14 @@ int single_damage_type(const item_def &item)
// Not adjusted by species or anything, which is why it's "basic".
hands_reqd_type basic_hands_reqd(const item_def &item, size_type size)
{
- ASSERT(is_weapon(item));
-
const int wpn_type = OBJ_WEAPONS == item.base_type ? item.sub_type :
OBJ_RODS == item.base_type ? WPN_ROD :
OBJ_STAVES == item.base_type ? WPN_STAFF :
WPN_UNKNOWN;
+ // Non-weapons.
if (wpn_type == WPN_UNKNOWN)
- return HANDS_ONE; // ???
+ return HANDS_ONE;
return size >= Weapon_prop[Weapon_index[wpn_type]].min_1h_size ? HANDS_ONE
: HANDS_TWO;
}