summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-12 22:33:11 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-12 22:33:11 +0000
commitdaffe68811f8666a4aaf25fa882fd0bfe196015f (patch)
treec62456ce86b9e10b3be5d02153441c4fd5584c19 /crawl-ref/source/itemprop.cc
parent3dbe5462b4b3113a209e0c00bc38dc324ef5b313 (diff)
downloadcrawl-ref-daffe68811f8666a4aaf25fa882fd0bfe196015f.tar.gz
crawl-ref-daffe68811f8666a4aaf25fa882fd0bfe196015f.zip
Add minor cleanups of the new helmet handling code: use is_hard_helmet()
instead of hardcoding references to caps and wizard hats when possible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3049 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 81f9a3209f..dc2fca1156 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -711,7 +711,7 @@ void set_equip_race( item_def &item, unsigned long flags )
}
break;
case OBJ_ARMOUR:
- if ((is_helmet(item) && !is_hard_helmet(item))
+ if ((get_armour_slot(item) == EQ_HELMET && !is_hard_helmet(item))
|| item.sub_type == ARM_ROBE
|| item.sub_type == ARM_LEATHER_ARMOUR
|| item.sub_type == ARM_STUDDED_LEATHER_ARMOUR)
@@ -736,7 +736,7 @@ void set_equip_race( item_def &item, unsigned long flags )
switch (item.base_type)
{
case OBJ_ARMOUR:
- if (is_helmet(item) && !is_hard_helmet(item))
+ if (get_armour_slot(item) == EQ_HELMET && !is_hard_helmet(item))
return;
break;
default:
@@ -764,7 +764,7 @@ void set_equip_desc( item_def &item, unsigned long flags )
//
short get_helmet_desc( const item_def &item )
{
- ASSERT( item.base_type == OBJ_ARMOUR
+ ASSERT( item.base_type == OBJ_ARMOUR
&& get_armour_slot( item ) == EQ_HELMET );
return item.plus2;
@@ -774,8 +774,7 @@ void set_helmet_desc( item_def &item, helmet_desc_type type )
{
ASSERT( is_helmet(item) );
- if ((item.sub_type == ARM_CAP || item.sub_type == ARM_WIZARD_HAT)
- && type > THELM_DESC_PLUMED)
+ if (!is_hard_helmet(item) && type > THELM_DESC_MAX_SOFT)
type = THELM_DESC_PLAIN;
item.plus2 = type;
@@ -1169,7 +1168,7 @@ bool check_armour_shape( const item_def &item, bool quiet )
break;
case EQ_HELMET:
- if (item.sub_type == ARM_CAP || item.sub_type == ARM_WIZARD_HAT)
+ if (!is_hard_helmet(item))
break;
if (you.species == SP_KENKU)
@@ -2307,7 +2306,7 @@ size_type item_size( const item_def &item )
size = SIZE_MEDIUM;
switch (item.sub_type)
{
- case ARM_GLOVES:
+ case ARM_GLOVES:
case ARM_HELMET:
case ARM_HELM:
case ARM_CAP: