diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-11-04 22:21:51 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-11-04 22:48:12 +0100 |
commit | 2fa5820369c3918944436bd1f96f46346190c478 (patch) | |
tree | 5aaa9811c2d9f07c73c4786f181c3594d823a5d8 /crawl-ref/source/makeitem.cc | |
parent | 24940bfaa94fd26d676a40d33c4d78438aa8315d (diff) | |
download | crawl-ref-2fa5820369c3918944436bd1f96f46346190c478.tar.gz crawl-ref-2fa5820369c3918944436bd1f96f46346190c478.zip |
Making an item randart can fail _and_ return true. Cope with that.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index dcbc80dc61..e124fa56dd 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -1623,8 +1623,8 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, { int i; int ego = item.special; - for (i=0; i<10; i++) - if (_try_make_weapon_artefact(item, force_type, 0, true)) + for (i=0; i<100; i++) + if (_try_make_weapon_artefact(item, force_type, 0, true) && is_artefact(item)) { if (ego > SPWPN_NORMAL) item.props[ARTEFACT_PROPS_KEY].get_vector()[ARTP_BRAND].get_short() = ego; @@ -2325,8 +2325,8 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, if (item_level == -6) { int i; - for (i=0; i<10; i++) - if (_try_make_armour_artefact(item, force_type, 0, true)) + for (i=0; i<100; i++) + if (_try_make_armour_artefact(item, force_type, 0, true) && is_artefact(item)) return; // fall back to an ordinary item item_level = MAKE_GOOD_ITEM; |