summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-04 17:07:43 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-04 17:07:43 +0000
commit1df63f2d24648d2467da71b81ba53f039e6539c0 (patch)
tree3d55cda95aa019b4949566362e55bec7e5155982 /crawl-ref/source/effects.cc
parentf5b7079207156bdd82d713a60cf79229fe33a109 (diff)
downloadcrawl-ref-1df63f2d24648d2467da71b81ba53f039e6539c0.tar.gz
crawl-ref-1df63f2d24648d2467da71b81ba53f039e6539c0.zip
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
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc11
1 files changed, 2 insertions, 9 deletions
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)