diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-29 20:00:51 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-11-29 20:00:51 +0000 |
commit | f6c4d4cc8ad1f3c297deb85397240117dcf731d4 (patch) | |
tree | 756b198600f3f666c90bf00f782b5aca4f699123 /crawl-ref/source/itemprop.cc | |
parent | bdc780ed167c098605f620a74238aec4f84e0c58 (diff) | |
download | crawl-ref-f6c4d4cc8ad1f3c297deb85397240117dcf731d4.tar.gz crawl-ref-f6c4d4cc8ad1f3c297deb85397240117dcf731d4.zip |
Move the disabling of elven maces/flails and dwarven polearms into
set_equip_race(), so that it isn't duplicated for both players and
monsters (both of which use this function).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2940 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index d17b970966..a6fe89442f 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -640,7 +640,7 @@ void set_equip_race( item_def &item, unsigned long flags ) case OBJ_ARMOUR: // not hides, dragon armour, crystal plate, or barding - if (item.sub_type >= ARM_DRAGON_HIDE + if (item.sub_type >= ARM_DRAGON_HIDE && item.sub_type <= ARM_SWAMP_DRAGON_ARMOUR && item.sub_type != ARM_CENTAUR_BARDING && item.sub_type != ARM_NAGA_BARDING) @@ -664,27 +664,32 @@ void set_equip_race( item_def &item, unsigned long flags ) // check that item is appropriate for racial type switch (flags) { - case ISFLAG_ELVEN: - if (item.base_type == OBJ_ARMOUR - && (item.sub_type == ARM_SPLINT_MAIL - || item.sub_type == ARM_BANDED_MAIL - || item.sub_type == ARM_PLATE_MAIL)) + 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))) { return; } break; - - case ISFLAG_DWARVEN: - if (item.base_type == OBJ_ARMOUR - && (item.sub_type == ARM_ROBE - || item.sub_type == ARM_LEATHER_ARMOUR - || item.sub_type == ARM_STUDDED_LEATHER_ARMOUR)) + + 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))) { return; } break; - case ISFLAG_ORCISH: + case ISFLAG_ORCISH: + default: break; } |