summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-10-25 14:43:26 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-10-25 14:43:26 +0100
commit6dca0fa1e8f2b2d6509e30e9b73c5104e8792709 (patch)
tree72f77645041b39daba71853e2ec05ee6cbbd29c3 /crawl-ref/source/player.cc
parent98b7f12e57c76638fd88f2d56bd54607267b392f (diff)
downloadcrawl-ref-6dca0fa1e8f2b2d6509e30e9b73c5104e8792709.tar.gz
crawl-ref-6dca0fa1e8f2b2d6509e30e9b73c5104e8792709.zip
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.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc16
1 files changed, 6 insertions, 10 deletions
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)