From ca500de9d74a21de788f21dc088bbb5b32a634b2 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Wed, 26 Jan 2022 07:02:23 -0800 Subject: [PATCH] Fixed pots being zero --- src/conversation/queue.c | 5 +++++ src/poker/poker.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/conversation/queue.c b/src/conversation/queue.c index fea9d0a..90cedd4 100644 --- a/src/conversation/queue.c +++ b/src/conversation/queue.c @@ -90,6 +90,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); diff --git a/src/poker/poker.c b/src/poker/poker.c index 8030777..5dec651 100644 --- a/src/poker/poker.c +++ b/src/poker/poker.c @@ -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;