From 4a6422fc0943ead0c32acbd4a927f93131cfbba8 Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Mon, 3 Sep 2018 08:43:05 +0200 Subject: [PATCH] Fixes non-existant treasure bug --- src/item_builder.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/item_builder.c b/src/item_builder.c index e4be90e..80b3e78 100644 --- a/src/item_builder.c +++ b/src/item_builder.c @@ -116,13 +116,14 @@ create_treasure(int current_level) unsigned int value; amt = (unsigned int) 1 + get_random(5*current_level) % 40; + amt = amt == 0 ? 1 : amt; if (current_level > 9) { - highest_treasure = TREASURE_COUNT; - } else if (current_level > 3) { highest_treasure = PLATINUM; - } else { + } else if (current_level > 3) { highest_treasure = GOLD; + } else { + highest_treasure = SILVER; } value = get_random(highest_treasure);