From 0ae4b3ebec27a790336ec36b0d3ab594d66f620d Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Wed, 4 Nov 2009 22:42:49 +0100 Subject: Fix test failure: need to clear the item before rerolling a randart. --- crawl-ref/source/makeitem.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/makeitem.cc') 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; -- cgit v1.2.3-54-g00ecf