From ad5a6d945d577066e146af8fabb2548c90d35211 Mon Sep 17 00:00:00 2001 From: un1xx Date: Wed, 21 Aug 2024 22:41:15 +0530 Subject: [PATCH] update warchest cmd (fix total calculation) --- exts/banking.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exts/banking.py b/exts/banking.py index 0282f91..54cb861 100644 --- a/exts/banking.py +++ b/exts/banking.py @@ -232,17 +232,17 @@ class Banking(commands.Cog): "steel40": 0 } for rd in resource_delta: - total["money"] += rd.get("money") - total["steel100"] += rd.get("steel100") - total["steel40"] += rd.get("steel40") - total["aluminum"] += rd.get("aluminum") - total["food"] += rd.get("food") - total["munitions"] += rd.get("munitions") - total["uranium"] += rd.get("uranium") - total["gasoline"] += rd.get("gasoline") + total["money"] += max(0, rd.get("money")) + total["steel100"] += max(0, rd.get("steel100")) + total["steel40"] += max(0, rd.get("steel40")) + total["aluminum"] += max(0, rd.get("aluminum")) + total["food"] +=max(0, rd.get("food")) + total["munitions"] += max(0, rd.get("munitions")) + total["uranium"] += max(0, rd.get("uranium")) + total["gasoline"] += max(0, rd.get("gasoline")) e.description += ( - "\n# Total warchest to transfer" + "\n **Total warchest to transfer**\n" f"{Emojis.money} {total.get('money'):,}\n" f"{Emojis.food} {total.get('food'):,}\n" f"{Emojis.uranium} {total.get('uranium'):,}\n"