diff options
Diffstat (limited to 'game.cpp')
-rw-r--r-- | game.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -641,6 +641,8 @@ void Game::userAI(Card **cards) int howManyUserCanDiscard = 0; int i; + /* XXX: handle straight */ + if (pairOrBetter(cards)) { int *cardsToDiscard = whichCardsToDiscard(cards); @@ -797,8 +799,12 @@ void Game::evaluateHand(Card **cards, int who) /* four of a kind */ else if (tmp2.count == 4) + { whatHand = 2; + sortFourOfAKind(cards, &tmp2); + } + /* XXX: flawed */ /* full house */ else if ((tmp2.count == 3) && (cards[3]->getType()[0] == cards[4]->getType()[0])) whatHand = 3; @@ -813,7 +819,10 @@ void Game::evaluateHand(Card **cards, int who) /* three of a kind */ else if (tmp2.count == 3) + { whatHand = 6; + sortThreeOfAKind(cards, &tmp2); + } /* two pair */ else if (hasTwoPairs(cards)) |