Skip to content

Commit 681a27c

Browse files
Fix bug where users could rob negative balances
1 parent 63c0470 commit 681a27c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/main/java/technobot/handlers/economy/EconomyHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public EconomyReply rob(long userID, long targetID) {
105105

106106
// Calculate mount stolen (success probability * their cash)
107107
long amountStolen = (long) ((1 - failChance) * targetCash);
108+
if (amountStolen < 0) amountStolen = 0;
108109

109110
// Attempt robbery
110111
setTimeout(userID, TIMEOUT_TYPE.ROB);

0 commit comments

Comments
 (0)