From 60c354622d72ded411e1ff4f11125986cdc04024 Mon Sep 17 00:00:00 2001 From: jamie-mac <> Date: Fri, 21 Jan 2022 20:34:40 +0000 Subject: [PATCH 1/2] Fixes incorrect result being detected on the roulette table Resolves #2382 Resolves #2086 --- src/Casino/Roulette.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Casino/Roulette.tsx b/src/Casino/Roulette.tsx index e9964d5f7..1a36bb2a3 100644 --- a/src/Casino/Roulette.tsx +++ b/src/Casino/Roulette.tsx @@ -118,12 +118,6 @@ export function Roulette(props: IProps): React.ReactElement { const [status, setStatus] = useState("waiting"); const [n, setN] = useState(0); const [lock, setLock] = useState(true); - const [strategy, setStrategy] = useState({ - payout: 0, - match: (): boolean => { - return false; - }, - }); useEffect(() => { const i = window.setInterval(step, 50); @@ -156,13 +150,12 @@ export function Roulette(props: IProps): React.ReactElement { return `${n}${color}`; } - function play(s: Strategy): void { + function play(strategy: Strategy): void { if (reachedLimit(props.p)) return; setCanPlay(false); setLock(false); setStatus("playing"); - setStrategy(s); setTimeout(() => { let n = Math.floor(rng.random() * 37); From 896384227695598cae248949dc424261f270a89c Mon Sep 17 00:00:00 2001 From: jamie-mac <> Date: Fri, 21 Jan 2022 21:28:25 +0000 Subject: [PATCH 2/2] Fixes black matching 0 on the roulette table --- src/Casino/Roulette.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Casino/Roulette.tsx b/src/Casino/Roulette.tsx index 1a36bb2a3..694067f47 100644 --- a/src/Casino/Roulette.tsx +++ b/src/Casino/Roulette.tsx @@ -40,13 +40,13 @@ const strategies: { } = { Red: { match: (n: number): boolean => { - if (n === 0) return false; return redNumbers.includes(n); }, payout: 1, }, Black: { match: (n: number): boolean => { + if (n === 0) return false; return !redNumbers.includes(n); }, payout: 1,