diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-05 18:04:59 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-05 18:04:59 +0000 |
commit | 436784b951a9914ec5488207c8b9d762586ebab5 (patch) | |
tree | 038d8467c7a6244925aa8b106a145b8f5580bbfd /crawl-ref/source | |
parent | 783a80c3a2a1f14ee4e02d1abd9bf9aef50d0595 (diff) | |
download | crawl-ref-436784b951a9914ec5488207c8b9d762586ebab5.tar.gz crawl-ref-436784b951a9914ec5488207c8b9d762586ebab5.zip |
Simplify.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8907 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 05135bf866..78d5513673 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -4115,25 +4115,11 @@ void give_armour(monsters *mon, int level) { item.base_type = OBJ_ARMOUR; - switch (random2(8)) - { - case 0: - case 1: - case 2: - case 3: - item.sub_type = ARM_LEATHER_ARMOUR; - break; - case 4: - case 5: - item.sub_type = ARM_RING_MAIL; - break; - case 6: - item.sub_type = ARM_SCALE_MAIL; - break; - case 7: - item.sub_type = ARM_CHAIN_MAIL; - break; - } + const int temp_rand = random2(8); + item.sub_type = ((temp_rand < 4) ? ARM_LEATHER_ARMOUR : + (temp_rand < 6) ? ARM_RING_MAIL : + (temp_rand == 6) ? ARM_SCALE_MAIL + : ARM_CHAIN_MAIL); } else return; |