Fixed pots being zero

This commit is contained in:
2022-01-26 07:02:23 -08:00
parent 8197721918
commit ca500de9d7
2 changed files with 7 additions and 2 deletions

View File

@@ -91,6 +91,11 @@ void conversationQueueBeginBetting() {
// Now we have their turn, decide what to say based on that.
}
// Update bet state
POKER_PLAYERS[POKER_PLAYER_BETTER].state |= (
POKER_PLAYER_STATE_HAS_BET_THIS_ROUND
);
if(turn.chips > 0) {
pokerBet(POKER_PLAYER_BETTER, turn.chips);
}

View File

@@ -39,7 +39,7 @@ void pokerInit() {
// TODO: Should this be randomized?
POKER_PLAYER_DEALER = 0;
POKER_GAME_BLINDS_CURRENT = 10;
POKER_PLAYER_COUNT = POKER_COMMUNITY_SIZE_MAX;
POKER_PLAYER_COUNT = 3;
// Set up players
for(i = 0; i < POKER_PLAYER_COUNT; i++) {
@@ -144,7 +144,7 @@ inline void pokerBet(uint8_t player, uint16_t amount) {
// player 1 has $1000, and bets all of it. The remanin
// player 2 has $700, and bets all o it. A new $300 sidepot auto creates
// player 3 has $500 and bets all of it, Another sidepot with $200 is auto made.
POKER_PLAYERS[player].state |= POKER_PLAYER_STATE_HAS_BET_THIS_ROUND;
if(POKER_POT_CURRENT == POKER_POT_COUNT) POKER_POT_COUNT++;
POKER_PLAYERS[player].chips -= amount;
POKER_POTS[POKER_POT_CURRENT].chips += amount;
POKER_POTS[POKER_POT_CURRENT].players[player] += amount;