diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-17 10:21:49 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-17 10:24:49 +0100 |
commit | 941e86d30ef962b832ffc690628edaca14183f73 (patch) | |
tree | b941b84f33077ba2af146eb2691b714b466c1a9f /crawl-ref/source/makeitem.cc | |
parent | 795d91157c2388fa481dd6341251a7f79a44bdd8 (diff) | |
download | crawl-ref-941e86d30ef962b832ffc690628edaca14183f73.tar.gz crawl-ref-941e86d30ef962b832ffc690628edaca14183f73.zip |
Put all armour brand logic into one place; this fixes an assert crash.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index c6dec74d41..1e8f2a6147 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2227,6 +2227,14 @@ static special_armour_type _determine_armour_ego(const item_def& item, break; default: + if (armour_is_hide(item, true) + || item.sub_type == ARM_ANIMAL_SKIN + || item.sub_type == ARM_CRYSTAL_PLATE_MAIL) + { + rc = SPARM_NORMAL; + break; + } + rc = coinflip() ? SPARM_COLD_RESISTANCE : SPARM_FIRE_RESISTANCE; if (one_chance_in(9)) @@ -2436,16 +2444,6 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, if (force_good) hide2armour(item); - // Skin armours and crystal plate mail normally don't get egos, but - // can be randarts. - if (armour_is_hide(item, true) - || item.sub_type == ARM_ANIMAL_SKIN - || item.sub_type == ARM_CRYSTAL_PLATE_MAIL) - { - if (!forced_ego) - set_item_ego_type(item, OBJ_ARMOUR, SPARM_NORMAL); - } - // Don't overenchant items. if (item.plus > armour_max_enchant(item)) item.plus = armour_max_enchant(item); |