From da2c6835866fc0ef70b5defdbea6c12dfa7611f8 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 11 Mar 2009 21:07:48 +0000 Subject: Make you_tran_can_wear take item size into account. (Fixes 2680313.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9414 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 972af81dd5..c7b9113470 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -665,6 +665,9 @@ bool you_tran_can_wear(const item_def &item) return (true); } + if (fit_armour_size(item, player_size(PSIZE_BODY, false)) != 0) + return (false); + return you_tran_can_wear(get_armour_slot(item), true); default: @@ -682,9 +685,7 @@ bool you_tran_can_wear(int eq, bool check_mutation) else if (eq >= EQ_RINGS && eq <= EQ_RINGS_PLUS2) eq = EQ_LEFT_RING; - const int transform = you.attribute[ATTR_TRANSFORMATION]; - - // Everybody else can wear at least some type of armour. + // Everybody can wear at least some type of armour. if (eq == EQ_ALL_ARMOUR) return (true); @@ -703,6 +704,8 @@ bool you_tran_can_wear(int eq, bool check_mutation) } } + const int transform = you.attribute[ATTR_TRANSFORMATION]; + // No further restrictions. if (transform == TRAN_NONE || transform == TRAN_LICH) return (true); -- cgit v1.2.3-54-g00ecf