From 8fa660a241de7b729125331c495a1e640853fd76 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Apr 2022 17:34:21 +0200 Subject: [PATCH] sdf --- files/helpers/treasure.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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