summaryrefslogtreecommitdiffstats
path: root/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game.cpp')
-rw-r--r--game.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/game.cpp b/game.cpp
index c0a0dd0..c7b78ae 100644
--- a/game.cpp
+++ b/game.cpp
@@ -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))