Fixed running more than the first hand in network games.
This commit is contained in:
@@ -620,10 +620,8 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
int action = curGame->getPlayerArray()[i]->getMyAction();
|
||||
if (action != 1 && action != 6)
|
||||
curGame->getPlayerArray()[i]->setMyAction(0);
|
||||
curGame->getPlayerArray()[i]->setMySetNull();
|
||||
}
|
||||
// Move sets to pot
|
||||
curGame->getCurrentHand()->getBoard()->collectSets();
|
||||
curGame->getCurrentHand()->getBoard()->collectPot();
|
||||
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
@@ -691,6 +689,12 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
// TODO use moneyWon
|
||||
client.GetGui().postRiverRunAnimation1();
|
||||
|
||||
// Reset player actions
|
||||
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++)
|
||||
{
|
||||
curGame->getPlayerArray()[i]->setMyAction(0);
|
||||
curGame->getPlayerArray()[i]->setMySetNull();
|
||||
}
|
||||
// Wait for next Hand.
|
||||
client.SetState(ClientStateWaitHand::Instance());
|
||||
retVal = MSG_NET_GAME_SERVER_HAND_END;
|
||||
@@ -712,9 +716,9 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
PlayerInterface *tmpPlayer = curGame->getPlayerByUniqueId((*i).playerId);
|
||||
assert(tmpPlayer); // TODO: throw exception
|
||||
|
||||
int tmpCards[2];
|
||||
tmpCards[0] = static_cast<int>((*i).cards[0]);
|
||||
tmpCards[1] = static_cast<int>((*i).cards[1]);
|
||||
int tmpCards[2];
|
||||
tmpCards[0] = static_cast<int>((*i).cards[0]);
|
||||
tmpCards[1] = static_cast<int>((*i).cards[1]);
|
||||
tmpPlayer->setMyCards(tmpCards);
|
||||
for (int num = 0; num < 5; num++)
|
||||
tmpPlayer->getMyBestHandPosition()[num] = (*i).bestHandPos[num];
|
||||
@@ -728,6 +732,12 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGame()->getCurrentHand()->getRiver()->setHighestCardsValue(highestValueOfCards);
|
||||
client.GetGui().postRiverRunAnimation1();
|
||||
|
||||
// Reset player sets
|
||||
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++)
|
||||
{
|
||||
curGame->getPlayerArray()[i]->setMyAction(0);
|
||||
curGame->getPlayerArray()[i]->setMySetNull();
|
||||
}
|
||||
// Wait for next Hand.
|
||||
client.SetState(ClientStateWaitHand::Instance());
|
||||
retVal = MSG_NET_GAME_SERVER_HAND_END;
|
||||
|
||||
Reference in New Issue
Block a user