Problem
Tavern.changeBet (src/location/tavern.py:242-256) only checks that the player can afford the amount:
self.amount = int(amount)
if self.player.canAfford(self.amount):
self.currentBet = self.amount
self.currentPrompt.text = (
"What will the dice land on? Current Bet: $%d" % self.currentBet
)
Player.canAfford is self.operatorMode or self.money >= cost (src/player/player.py:64-65), so any negative amount passes — money >= -100 is true for any balance. Entering -100 sets currentBet = -100 and the game reports "What will the dice land on? Current Bet: $-100".
Picking a number then hits the guard in Tavern.gamble (src/location/tavern.py:207):
if 1 <= input <= 6 and self.currentBet > 0:
which is false, so the player falls to the else branch and is told "You didn't bet any money!" — directly contradicting the bet the game just confirmed. There is no way to notice the bet was rejected other than trying to roll.
Not an exploit: because of the self.currentBet > 0 guard the losing branch (spendMoney(self.currentBet), which for a negative bet would add money) is unreachable. This is a validation and messaging bug, not a money bug.
Suggested fix
Reject amounts below $1 in changeBet with a message that says so, alongside the existing "not enough money" branch, so the confirmed bet always matches what gamble() will accept.
Test
tests/location/test_tavern.py already covers changeBet for the affordable and unaffordable cases; a negative-amount case belongs next to them.
Problem
Tavern.changeBet(src/location/tavern.py:242-256) only checks that the player can afford the amount:Player.canAffordisself.operatorMode or self.money >= cost(src/player/player.py:64-65), so any negative amount passes —money >= -100is true for any balance. Entering-100setscurrentBet = -100and the game reports "What will the dice land on? Current Bet: $-100".Picking a number then hits the guard in
Tavern.gamble(src/location/tavern.py:207):which is false, so the player falls to the
elsebranch and is told "You didn't bet any money!" — directly contradicting the bet the game just confirmed. There is no way to notice the bet was rejected other than trying to roll.Not an exploit: because of the
self.currentBet > 0guard the losing branch (spendMoney(self.currentBet), which for a negative bet would add money) is unreachable. This is a validation and messaging bug, not a money bug.Suggested fix
Reject amounts below $1 in
changeBetwith a message that says so, alongside the existing "not enough money" branch, so the confirmed bet always matches whatgamble()will accept.Test
tests/location/test_tavern.pyalready coverschangeBetfor the affordable and unaffordable cases; a negative-amount case belongs next to them.