Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -95,6 +95,8 @@ void LocalBoard::distributePot()
|
|||||||
// temp var
|
// temp var
|
||||||
int highestCardsValue;
|
int highestCardsValue;
|
||||||
size_t winnerCount;
|
size_t winnerCount;
|
||||||
|
bool finalPot;
|
||||||
|
int potCarryOver = 0;
|
||||||
size_t mod;
|
size_t mod;
|
||||||
bool winnerHit;
|
bool winnerHit;
|
||||||
|
|
||||||
@@ -111,7 +113,7 @@ void LocalBoard::distributePot()
|
|||||||
potLevel.push_back(playerSetsSort[i]);
|
potLevel.push_back(playerSetsSort[i]);
|
||||||
|
|
||||||
// level sum
|
// level sum
|
||||||
potLevel.push_back((playerSetsSort.size()-i)*potLevel[0]);
|
potLevel.push_back((playerSetsSort.size()-i)*potLevel[0] + potCarryOver);
|
||||||
|
|
||||||
// determine level highestCardsValue
|
// determine level highestCardsValue
|
||||||
for(it_c=seatsList->begin(), j=0; it_c!=seatsList->end(); ++it_c,j++) {
|
for(it_c=seatsList->begin(), j=0; it_c!=seatsList->end(); ++it_c,j++) {
|
||||||
@@ -133,6 +135,20 @@ void LocalBoard::distributePot()
|
|||||||
throw LocalException(__FILE__, __LINE__, ERR_NO_WINNER);
|
throw LocalException(__FILE__, __LINE__, ERR_NO_WINNER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if this is the final pot level for at least one winner
|
||||||
|
finalPot = false;
|
||||||
|
for(j=2; j<potLevel.size(); j++) {
|
||||||
|
// find seat with potLevel[j]-ID
|
||||||
|
for(it=seatsList->begin(), k=0; it!=seatsList->end(); ++it, k++) {
|
||||||
|
if((*it)->getMyUniqueID() == potLevel[j] && potLevel[0] == playerSets[k]) {
|
||||||
|
finalPot = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(finalPot) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(finalPot) {
|
||||||
// distribute the pot level sum to level winners
|
// distribute the pot level sum to level winners
|
||||||
mod = (potLevel[1])%winnerCount;
|
mod = (potLevel[1])%winnerCount;
|
||||||
// pot level sum divisible by winnerCount
|
// pot level sum divisible by winnerCount
|
||||||
@@ -199,6 +215,14 @@ void LocalBoard::distributePot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
potCarryOver = 0;
|
||||||
|
|
||||||
|
// pot refresh
|
||||||
|
pot -= potLevel[1];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
potCarryOver = potLevel[1];
|
||||||
|
}
|
||||||
|
|
||||||
// reevaluate the player sets
|
// reevaluate the player sets
|
||||||
for(j=0; j<playerSets.size(); j++) {
|
for(j=0; j<playerSets.size(); j++) {
|
||||||
@@ -211,9 +235,6 @@ void LocalBoard::distributePot()
|
|||||||
playerSetsSort = playerSets;
|
playerSetsSort = playerSets;
|
||||||
sort(playerSetsSort.begin(), playerSetsSort.end());
|
sort(playerSetsSort.begin(), playerSetsSort.end());
|
||||||
|
|
||||||
// pot refresh
|
|
||||||
pot -= potLevel[1];
|
|
||||||
|
|
||||||
// clear potLevel
|
// clear potLevel
|
||||||
potLevel.clear();
|
potLevel.clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user