From 6dca0fa1e8f2b2d6509e30e9b73c5104e8792709 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Sun, 25 Oct 2009 14:43:26 +0100 Subject: Make all but one weapon size checks use you.could_wield(), they were out of sync, that caused autoexplore ignore butchering knives for nagas, many weapons being randomly shown as useless while perfectly wieldable, and so on. --- crawl-ref/source/player.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index a22749f530..42be71c2dd 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -761,15 +761,6 @@ bool player_weapon_wielded() return (false); } - // FIXME: This needs to go in eventually. - /* - // should never have a bad "shape" weapon in hand - ASSERT( check_weapon_shape( you.inv[wpn], false ) ); - - if (!check_weapon_wieldable_size( you.inv[wpn], you.body_size() )) - return (false); - */ - return (true); } @@ -6311,7 +6302,12 @@ bool player::can_wield(const item_def& item, bool ignore_curse, bool player::could_wield(const item_def &item, bool ignore_brand, bool /* ignore_transform */) const { - if (!check_weapon_wieldable_size(item, body_size())) + if (body_size(PSIZE_TORSO) < SIZE_LARGE && item_mass(item) >= 300) + return (false); + + // Small species wielding large weapons... + if (body_size(PSIZE_BODY) < SIZE_MEDIUM + && !check_weapon_wieldable_size(item, body_size(PSIZE_BODY))) return (false); if (!ignore_brand) -- cgit v1.2.3-54-g00ecf