summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makeitem.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-04 22:42:49 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-04 22:48:13 +0100
commit0ae4b3ebec27a790336ec36b0d3ab594d66f620d (patch)
tree2ae24bd404dd77e5c0d8dba990f02394ea810759 /crawl-ref/source/makeitem.cc
parent700f4d873b39f35bfe71ad6238ed41e05e79b13a (diff)
downloadcrawl-ref-0ae4b3ebec27a790336ec36b0d3ab594d66f620d.tar.gz
crawl-ref-0ae4b3ebec27a790336ec36b0d3ab594d66f620d.zip
Fix test failure: need to clear the item before rerolling a randart.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r--crawl-ref/source/makeitem.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index ad69b42beb..aa566ac2e6 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -1628,8 +1628,15 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques,
{
if (ego > SPWPN_NORMAL)
item.props[ARTEFACT_PROPS_KEY].get_vector()[ARTP_BRAND].get_short() = ego;
- if (!randart_is_bad(item)) // recheck, the brand changed
- return;
+ if (randart_is_bad(item)) // recheck, the brand changed
+ {
+ force_type = item.sub_type;
+ item.clear();
+ item.base_type = OBJ_WEAPONS;
+ item.sub_type = force_type;
+ continue;
+ }
+ return;
}
// fall back to an ordinary item
item_level = MAKE_GOOD_ITEM;