From 941e86d30ef962b832ffc690628edaca14183f73 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Thu, 17 Dec 2009 10:21:49 +0100 Subject: Put all armour brand logic into one place; this fixes an assert crash. --- crawl-ref/source/makeitem.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'crawl-ref') 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); -- cgit v1.2.3-54-g00ecf