Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MISC: Validate bet input of casino mini games #1694

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

catloversg
Copy link
Contributor

The "bet input" of 3 games (Coin flip, Slot machine, Roulette) has many problems:

  • The validation logic is duplicated.
  • The validation logic does not check the current player's money.
  • When the bet amount is "out-of-range", it's silently changed to the min/max value.
  • When the bet amount is invalid, there is no error shown in the UI.
  • There is no way to know the max bet amount of a game.

Blackjack does not have these problems, so this PR pulls the "bet input" of Blackjack out and reuses it in other games.

Before:
before

After:
after

@d0sboots
Copy link
Collaborator

Nice, the greater consistency looks good. This will of course mess up existing Casino scripts (again) XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants