summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 05:10:39 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-30 05:10:39 +0000
commitf6a1d5082c4ae9853ded65581030b86f5c7991fb (patch)
treef0004c7d1aeff2edb51b7c72a2ffe3bf6f57a627 /crawl-ref/source/itemprop.cc
parent31151c9dae68053ae4240151ea97feab423ed6da (diff)
downloadcrawl-ref-f6a1d5082c4ae9853ded65581030b86f5c7991fb.tar.gz
crawl-ref-f6a1d5082c4ae9853ded65581030b86f5c7991fb.zip
Clean up set_equip_race() to make it more readable, and also to properly
disable elven bolts and dwarven arrows (so that e.g. dwarven transmuters don't start with the latter). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2944 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r--crawl-ref/source/itemprop.cc52
1 files changed, 38 insertions, 14 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 85c76271ea..3d37186e8a 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -667,26 +667,50 @@ void set_equip_race( item_def &item, unsigned long flags )
switch (flags)
{
case ISFLAG_ELVEN:
- if ((item.base_type == OBJ_WEAPONS
- && weapon_skill(item) == SK_MACES_FLAILS)
- || (item.base_type == OBJ_ARMOUR
- && (item.sub_type == ARM_SPLINT_MAIL
- || item.sub_type == ARM_BANDED_MAIL
- || item.sub_type == ARM_PLATE_MAIL)))
+ switch (item.base_type)
{
- return;
+ case OBJ_WEAPONS:
+ if (weapon_skill(item) == SK_MACES_FLAILS)
+ return;
+ break;
+ case OBJ_ARMOUR:
+ if (item.sub_type == ARM_SPLINT_MAIL
+ || item.sub_type == ARM_BANDED_MAIL
+ || item.sub_type == ARM_PLATE_MAIL)
+ {
+ return;
+ }
+ break;
+ case OBJ_MISSILES:
+ if (item.sub_type == MI_BOLT)
+ return;
+ break;
+ default:
+ break;
}
break;
case ISFLAG_DWARVEN:
- if ((item.base_type == OBJ_WEAPONS
- && weapon_skill(item) == SK_POLEARMS)
- || (item.base_type == OBJ_ARMOUR
- && (item.sub_type == ARM_ROBE
- || item.sub_type == ARM_LEATHER_ARMOUR
- || item.sub_type == ARM_STUDDED_LEATHER_ARMOUR)))
+ switch (item.base_type)
{
- return;
+ case OBJ_WEAPONS:
+ if (weapon_skill(item) == SK_POLEARMS)
+ return;
+ break;
+ case OBJ_ARMOUR:
+ if (item.sub_type == ARM_ROBE
+ || item.sub_type == ARM_LEATHER_ARMOUR
+ || item.sub_type == ARM_STUDDED_LEATHER_ARMOUR)
+ {
+ return;
+ }
+ break;
+ case OBJ_MISSILES:
+ if (item.sub_type == MI_ARROW)
+ return;
+ break;
+ default:
+ break;
}
break;