From c4df9428469dd2dd2a52747aa69ba6a8fa590f5c Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 22 Nov 2022 21:00:03 -0500 Subject: [PATCH] Fix roulette '0' bet placement & display. --- files/helpers/roulette.py | 14 +++++++------- files/templates/casino/roulette_screen.html | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/files/helpers/roulette.py b/files/helpers/roulette.py index f695b6341..735c89eb4 100644 --- a/files/helpers/roulette.py +++ b/files/helpers/roulette.py @@ -20,13 +20,13 @@ class RouletteAction(str, Enum): @property def validation_function(self): - if self == self.__class__.STRAIGHT_UP_BET: return lambda x:x and x >= 0 and x <= 37 - if self == self.__class__.LINE_BET: return lambda x:x in LINES - if self == self.__class__.COLUMN_BET: return lambda x:x in COLUMNS - if self == self.__class__.DOZEN_BET: return lambda x:x in DOZENS - if self == self.__class__.EVEN_ODD_BET: return lambda x:x in [y.value for y in RouletteEvenOdd] - if self == self.__class__.RED_BLACK_BET: return lambda x:x in [y.value for y in RouletteRedBlack] - if self == self.__class__.HIGH_LOW_BET: return lambda x:x in [y.value for y in RouletteHighLow] + if self == self.__class__.STRAIGHT_UP_BET: return lambda x: x is not None and x >= 0 and x <= 37 + if self == self.__class__.LINE_BET: return lambda x: x in LINES + if self == self.__class__.COLUMN_BET: return lambda x: x in COLUMNS + if self == self.__class__.DOZEN_BET: return lambda x: x in DOZENS + if self == self.__class__.EVEN_ODD_BET: return lambda x: x in [y.value for y in RouletteEvenOdd] + if self == self.__class__.RED_BLACK_BET: return lambda x: x in [y.value for y in RouletteRedBlack] + if self == self.__class__.HIGH_LOW_BET: return lambda x: x in [y.value for y in RouletteHighLow] raise ValueError("Unhandled validation function for RouletteAction") diff --git a/files/templates/casino/roulette_screen.html b/files/templates/casino/roulette_screen.html index 1b186073e..dac0aed21 100644 --- a/files/templates/casino/roulette_screen.html +++ b/files/templates/casino/roulette_screen.html @@ -293,8 +293,9 @@ for (const individualBet of wagers) { const coinText = individualBet.amounts.coins > 0 ? `${individualBet.amounts.coins} ${coinImgHtml}` : ""; const procoinText = individualBet.amounts.marseybux > 0 ? `${individualBet.amounts.marseybux} ${marseybuxImgHtml}` : ""; + const straightUpWhich = (individualBet.which == 37) ? "00" : individualBet.which; const details = { - STRAIGHT_UP_BET: `that the number will be ${individualBet.which}`, + STRAIGHT_UP_BET: `that the number will be ${straightUpWhich}`, LINE_BET: `that the number will be within line ${individualBet.which}`, COLUMN_BET: `that the number will be within column ${individualBet.which}`, DOZEN_BET: `that the number will be within dozen ${individualBet.which}`,