Only allow valid inputs as bets.

This commit is contained in:
greek 2024-06-08 12:25:20 +01:00
parent 4b19c90450
commit 6e770239c8
2 changed files with 2 additions and 1 deletions

View file

@ -17,6 +17,8 @@ Dialog {
TextField { TextField {
id: input id: input
focus: true focus: true
/* No negative numners or leading 0s, and cap at 99 million */
validator: RegularExpressionValidator { regularExpression: /[1-9][0-9]{0,7}/ }
anchors { anchors {
left: parent.left left: parent.left

View file

@ -140,7 +140,6 @@ void PlayerAreaModel::payout()
if (betType != NONE) { if (betType != NONE) {
betSpot = players.at(i).bet2.betSpot; betSpot = players.at(i).bet2.betSpot;
if (betType == SINGLE && betSpot <= 35) { if (betType == SINGLE && betSpot <= 35) {
printf("SINGLLEEE\n");
betSpot = 36 - betSpot; betSpot = 36 - betSpot;
} else { } else {
betSpot += 1; betSpot += 1;