From 1df63f2d24648d2467da71b81ba53f039e6539c0 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 4 Feb 2009 17:07:43 +0000 Subject: Partially fix get_random_armour_type being completely broken (e.g. wizard hats and caps can get generated again.) get_random_armour_type makes assumptions about the order of armour_type, which were invalidated by r8681; I'm hesitant to touch the order again for fear of breaking something. dolorous, can you check? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8891 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/effects.cc | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/effects.cc') diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 58016e05a5..2b1ba69280 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1145,15 +1145,8 @@ static int _acquirement_jewellery_subtype() for (int i = 0; i < 10; i++) { // 1/3 amulets, 2/3 rings. - if (one_chance_in(3)) - { - result = AMU_FIRST_AMULET - + random2(NUM_JEWELLERY - AMU_FIRST_AMULET); - } - else - { - result = random2(NUM_RINGS); - } + result = (one_chance_in(3) ? get_random_amulet_type() + : get_random_ring_type()); // If we haven't seen this yet, we're done. if (get_ident_type(OBJ_JEWELLERY, result) == ID_UNKNOWN_TYPE) -- cgit v1.2.3-54-g00ecf