Fixed betting bugs.

This commit is contained in:
2021-09-27 14:27:13 -07:00
parent 733c311d5e
commit d4cc907506
22 changed files with 169 additions and 62 deletions

View File

@@ -10,9 +10,7 @@
void _pokerActionBlindsOnStart(queue_t *queue,queueaction_t *action,uint8_t i) {
poker_t *poker;
poker = (poker_t *)action->data;
poker->state = POKER_STATE_TAKING_BLINDS;
pokerBetTakeBlinds(
&poker->bet,
poker->players,

View File

@@ -11,9 +11,9 @@ void _pokerActionDealOnStart(queue_t *queue, queueaction_t *action, uint8_t i) {
poker_t *poker;
poker = (poker_t *)action->data;
poker->state = POKER_STATE_DEALING;
// Shuffle the deck
poker->state = POKER_STATE_DEALING;
cardShuffle(poker->dealer.deck, CARD_DECK_SIZE);
// Deal 2 card to each player

View File

@@ -30,13 +30,14 @@ void _pokerActionRoundOnStart(queue_t *queue, queueaction_t *action ,uint8_t i){
// Decide on the dealer
poker->roundDealer = (poker->roundDealer+1) % POKER_PLAYER_COUNT;
// Find the players.
// Find (and kill) the players.
j = poker->roundDealer;
foundDealer = false;
foundSmallBlind = false;
while(true) {
player = poker->players + j;
if(!pokerPlayerIsAlive(player)) continue;
if(!pokerPlayerIsInRound(player)) continue;
if(!foundDealer) {
indexDealer = j;
foundDealer = true;