From 72760b7751173d389735f6f129f92ef5963b1adc Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 2 Jul 2008 21:57:31 +0000 Subject: Fix 2009014: dwarven accessories could be overenchanted on generation. (OK, so it could be considered a feature.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6353 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/makeitem.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crawl-ref') diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 0824c476c2..6ae00c98fe 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2162,6 +2162,16 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, if (!forced_ego) set_item_ego_type( item, OBJ_ARMOUR, SPARM_NORMAL ); } + + // Don't overenchant items. FIXME: should use some kind of + // max_enchantment() function here. + if ( (item.sub_type >= ARM_CLOAK && item.sub_type <= ARM_BOOTS) + || is_shield(item) ) + { + if ( item.plus > 2 ) + item.plus = 2; + } + } static monster_type _choose_random_monster_corpse() -- cgit v1.2.3-54-g00ecf