diff --git a/files/helpers/treasure.py b/files/helpers/treasure.py index ab8b5b8d8..a383f37ff 100644 --- a/files/helpers/treasure.py +++ b/files/helpers/treasure.py @@ -16,12 +16,13 @@ def check_for_treasure(in_text, from_comment): amount = random.randint(special_min, special_max) elif is_standard: amount = random.randint(standard_min, standard_max) - if random.randint(1, 100) > 90: amount = -amount + if random.randint(1, 100) > 90: + if amount > user.coins: amount = user.coins + amount = -amount + if amount != 0: user = from_comment.author user.coins += amount - if user.coins < 0: user.coins = 0 - from_comment.treasure_amount = str(amount) \ No newline at end of file