bugfix: segfault in kicker detection

This commit is contained in:
doitux
2007-09-23 17:07:52 +00:00
parent d52ff7e830
commit 8f029d2ea4
4 changed files with 60 additions and 33 deletions
+13 -13
View File
@@ -1284,7 +1284,7 @@ QString Log::determineHandName(int myCardsValueInt) {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/1000000) == (myCardsValueInt/1000000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1308,7 +1308,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
*/
}
break;
// Full House
@@ -1321,7 +1321,7 @@ QString Log::determineHandName(int myCardsValueInt) {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/1000000) == (myCardsValueInt/1000000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1398,7 +1398,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
}
*/
}
break;
// Straight
@@ -1410,7 +1410,7 @@ QString Log::determineHandName(int myCardsValueInt) {
case 3: {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/1000000) == (myCardsValueInt/1000000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1451,7 +1451,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
}
*/
}
break;
// Two Pairs
@@ -1459,7 +1459,7 @@ QString Log::determineHandName(int myCardsValueInt) {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1)+translateCardsValueCode(myCardsValueInt).at(2);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/10000) == (myCardsValueInt/10000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1483,7 +1483,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
*/
}
break;
// Pair
@@ -1491,7 +1491,7 @@ QString Log::determineHandName(int myCardsValueInt) {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/1000000) == (myCardsValueInt/1000000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1550,7 +1550,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
}
*/
}
break;
// highestCard
@@ -1558,7 +1558,7 @@ QString Log::determineHandName(int myCardsValueInt) {
handName = translateCardsValueCode(myCardsValueInt).at(0)+translateCardsValueCode(myCardsValueInt).at(1);
/* // same hand detection
// same hand detection
for(it = shownCardsValueInt.begin(); it != shownCardsValueInt.end(); it++) {
if(((*it)/1000000) == (myCardsValueInt/1000000)) {
sameHandCardsValueInt.push_back(*it);
@@ -1608,7 +1608,7 @@ QString Log::determineHandName(int myCardsValueInt) {
it++;
} else {
different = true;
sameHandCardsValueInt.erase(it);
it = sameHandCardsValueInt.erase(it);
}
}
if(different) {
@@ -1635,7 +1635,7 @@ QString Log::determineHandName(int myCardsValueInt) {
}
}
}
*/
}
break;
default: {}
+1 -1
View File
@@ -735,7 +735,7 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) {
startData.numberOfPlayers = gameData.maxNumberOfPlayers;
Tools::getRandNumber(0, startData.numberOfPlayers-1, 1, &tmpDealerPos, 0);
if(DEBUG_MODE) {
// tmpDealerPos = 2;
tmpDealerPos = 3;
}
startData.startDealerPlayerId = static_cast<unsigned>(tmpDealerPos);