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
+26 -13
View File
@@ -106,11 +106,11 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
case 1: {
tempBoardArray[0] = 3;
tempBoardArray[1] = 16;
tempBoardArray[2] = 29;
tempBoardArray[3] = 0;
tempBoardArray[4] = 6;
tempBoardArray[0] = 5;
tempBoardArray[1] = 51;
tempBoardArray[2] = 3;
tempBoardArray[3] = 21;
tempBoardArray[4] = 13;
myBoard->setMyCards(tempBoardArray);
@@ -122,8 +122,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player0
tempPlayerArray[0] = 12;
tempPlayerArray[1] = 15;
tempPlayerArray[0] = 7;
tempPlayerArray[1] = 37;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -134,8 +134,8 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player1
tempPlayerArray[0] = 10;
tempPlayerArray[1] = 28;
tempPlayerArray[0] = 24;
tempPlayerArray[1] = 19;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -146,7 +146,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
// player2
tempPlayerArray[0] = 25;
/* tempPlayerArray[0] = 25;
tempPlayerArray[1] = 36;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -154,12 +154,12 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
playerArray[2]->setMyCards(tempPlayerArray);
playerArray[2]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[2]->setMyBestHandPosition(temp5Array);
playerArray[2]->setMyBestHandPosition(temp5Array);*/
// player3
tempPlayerArray[0] = 51;
tempPlayerArray[1] = 34;
tempPlayerArray[0] = 38;
tempPlayerArray[1] = 22;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
@@ -168,6 +168,19 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardI
playerArray[3]->setMyBestHandPosition(temp5Array);
// player4
tempPlayerArray[0] = 25;
tempPlayerArray[1] = 16;
tempPlayerAndBoardArray[0] = tempPlayerArray[0];
tempPlayerAndBoardArray[1] = tempPlayerArray[1];
playerArray[3]->setMyCards(tempPlayerArray);
playerArray[3]->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array));
playerArray[3]->setMyBestHandPosition(temp5Array);
} break;
case 2: {
+20 -6
View File
@@ -856,17 +856,23 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq
if(myID==0) {
// myActiveStatus=0;
// myCash=11980;
myCash=14800;
}
if(myID==1) {
// myCash=4505;
myCash=400;
}
if(myID==2) {
// myCash=9985;
myCash=4950;
}
if(myID==3) {
// myCash=8530;
myCash=5250;
}
if(myID==4) {
myCash=5100;
}
if(myID==5) {
myCash=4500;
}
}
@@ -1195,7 +1201,7 @@ void LocalPlayer::preflopEngine() {
switch(actualHand->getMyID()) {
case 1: {
// myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_FOLD;
// raise = 20;
// if(mySet >= 40) {
// myAction = PLAYER_ACTION_CALL;
@@ -1217,7 +1223,15 @@ void LocalPlayer::preflopEngine() {
}
break;
case 3: {
// myAction = PLAYER_ACTION_CALL;
myAction = PLAYER_ACTION_CALL;
}
break;
case 4: {
myAction = PLAYER_ACTION_CALL;
}
break;
case 5: {
myAction = PLAYER_ACTION_FOLD;
}
break;
default: {}