🐛 Players can't bet negative amounts
This commit is contained in:
@ -195,6 +195,7 @@ def blackjackPlayerDrawHand(channel,user,bet):
|
|||||||
if user not in data["blackjack games"][channel]["user hands"]:
|
if user not in data["blackjack games"][channel]["user hands"]:
|
||||||
if len(data["blackjack games"][channel]["user hands"]) < 5:
|
if len(data["blackjack games"][channel]["user hands"]) < 5:
|
||||||
if data["blackjack games"][channel]["open for bets"]:
|
if data["blackjack games"][channel]["open for bets"]:
|
||||||
|
if bet >= 0:
|
||||||
if money.checkBalance(user) >= bet:
|
if money.checkBalance(user) >= bet:
|
||||||
money.addMoney(user,-1 * bet)
|
money.addMoney(user,-1 * bet)
|
||||||
playerHand = [drawCard(),drawCard()]
|
playerHand = [drawCard(),drawCard()]
|
||||||
@ -217,6 +218,9 @@ def blackjackPlayerDrawHand(channel,user,bet):
|
|||||||
else:
|
else:
|
||||||
logThis(user+" doesn't have enough GwendoBucks")
|
logThis(user+" doesn't have enough GwendoBucks")
|
||||||
return "You don't have enough GwendoBucks to place that bet"
|
return "You don't have enough GwendoBucks to place that bet"
|
||||||
|
else:
|
||||||
|
logThis(user+" tried to bet a negative amount")
|
||||||
|
return "You can't bet a negative amount"
|
||||||
else:
|
else:
|
||||||
logThis("The table is no longer open for bets")
|
logThis("The table is no longer open for bets")
|
||||||
return "The table is no longer open for bets"
|
return "The table is no longer open for bets"
|
||||||
|
Reference in New Issue
Block a user