chrisparsons83 / flexspotff

Website for https://www.flexspotff.com
0 stars 2 forks source link

Spread pool math incorrect when switching teams in one go #75

Closed chrisparsons83 closed 1 month ago

chrisparsons83 commented 1 month ago

From CodeMonkey:

If I make a bet, and then directly move that bet to the other side without going through 0, the math for "currently bet" and "available to bet" go wonky.

Example - I have everything bet. So "0 remaining, 800 currently bet". If I take my 50 bet on Pats vs Jets from "50 on Pats" to "10 on Jets", it changes to "-10 available, 810 currently bet". Changing to 50 on Jets gives me "-50, 850"

The only way to fix the numbers is to take that wager back to neutral again, at which point it resets to normal

This is probably making sure a side is set to 0 every time you make a switch