summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makeitem.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 21:57:31 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-02 21:57:31 +0000
commit72760b7751173d389735f6f129f92ef5963b1adc (patch)
tree8077850bc423fef2cdc34769674cede277f07d26 /crawl-ref/source/makeitem.cc
parent5203a737852db82ce511775fc025dfcc532be4d9 (diff)
downloadcrawl-ref-72760b7751173d389735f6f129f92ef5963b1adc.tar.gz
crawl-ref-72760b7751173d389735f6f129f92ef5963b1adc.zip
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
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r--crawl-ref/source/makeitem.cc10
1 files changed, 10 insertions, 0 deletions
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()