From 97617753fa0e00f4698e1a1f34bd88a7b93f07de Mon Sep 17 00:00:00 2001 From: floty Date: Thu, 15 Jan 2009 22:11:45 +0000 Subject: [PATCH] fixes: "Bug ID 0000003: Low straight flush (with A) incorrectly picked" --> http://www.pokerth.net/mantis/view.php?id=3 --- src/engine/local_engine/cardsvalue.cpp | 28 ++++++++++++---------- src/engine/local_engine/localhand.cpp | 32 ++++++++++++------------- src/engine/local_engine/localplayer.cpp | 16 ++++++------- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/src/engine/local_engine/cardsvalue.cpp b/src/engine/local_engine/cardsvalue.cpp index 67cae5d7..1d8a858b 100755 --- a/src/engine/local_engine/cardsvalue.cpp +++ b/src/engine/local_engine/cardsvalue.cpp @@ -283,20 +283,24 @@ int array[7][3]; return 800000000+array[j1][1]*1000000; } } - else { - // Straight Flush Ausnahme: 5-4-3-2-A - for(j2=j1+1; j2<4; j2++) { - if(array[j1][1]-9==array[j2][1] && array[j2][1]-1==array[j2+1][1] && array[j2+1][1]-1==array[j2+2][1] && array[j2+2][1]-1==array[j2+3][1] && array[j1][0]==array[j2+2][0] && array[j1][0]==array[j2+3][0]) { - // Straight Flush mit 5 als höchste Karte -> 8*100000000+3*1000000 - if(position) { - // Position-Array fuellen - position[0] = array[j1][2]; - for(j3=1; j3<5; j3++) { - position[j3] = array[j2+j3][2]; - } + } + } + + // Straight Flush Ausnahme: 5-4-3-2-A + for(j1=0; j1<3; j1++) { + // 5 Karten gleiche Farbe ? + if(array[j1][0] == array[j1+1][0] && array[j1][0] == array[j1+2][0] && array[j1][0] == array[j1+3][0] && array[j1][0] == array[j1+4][0]) { + for(j2=j1+1; j2<4; j2++) { + if(array[j1][1]-9==array[j2][1] && array[j2][1]-1==array[j2+1][1] && array[j2+1][1]-1==array[j2+2][1] && array[j2+2][1]-1==array[j2+3][1] && array[j1][0]==array[j2+2][0] && array[j1][0]==array[j2+3][0]) { + // Straight Flush mit 5 als höchste Karte -> 8*100000000+3*1000000 + if(position) { + // Position-Array fuellen + position[0] = array[j1][2]; + for(j3=1; j3<5; j3++) { + position[j3] = array[j2+j3][2]; } - return 800000000+3*1000000; } + return 800000000+3*1000000; } } } diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 26d76ee4..ea2937dd 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -104,11 +104,11 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI case 1: { - tempBoardArray[0] = 32; - tempBoardArray[1] = 24; - tempBoardArray[2] = 31; - tempBoardArray[3] = 47; - tempBoardArray[4] = 19; + tempBoardArray[0] = 43; + tempBoardArray[1] = 27; + tempBoardArray[2] = 26; + tempBoardArray[3] = 29; + tempBoardArray[4] = 28; myBoard->setMyCards(tempBoardArray); @@ -121,8 +121,8 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // player0 it = seatsList->begin(); - tempPlayerArray[0] = 12; - tempPlayerArray[1] = 44; + tempPlayerArray[0] = 30; + tempPlayerArray[1] = 38; tempPlayerAndBoardArray[0] = tempPlayerArray[0]; tempPlayerAndBoardArray[1] = tempPlayerArray[1]; @@ -199,15 +199,15 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // player6 it++; -// tempPlayerArray[0] = 13; -// tempPlayerArray[1] = 49; -// tempPlayerAndBoardArray[0] = tempPlayerArray[0]; -// tempPlayerAndBoardArray[1] = tempPlayerArray[1]; -// -// (*it)->setMyCards(tempPlayerArray); -// (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); -// -// (*it)->setMyBestHandPosition(temp5Array); + tempPlayerArray[0] = 22; + tempPlayerArray[1] = 41; + tempPlayerAndBoardArray[0] = tempPlayerArray[0]; + tempPlayerAndBoardArray[1] = tempPlayerArray[1]; + + (*it)->setMyCards(tempPlayerArray); + (*it)->setMyCardsValueInt(myCardsValue.cardsValue(tempPlayerAndBoardArray,temp5Array)); + + (*it)->setMyBestHandPosition(temp5Array); } break; diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 97da4d51..7d13f3fa 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -859,25 +859,25 @@ LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniq switch(myUniqueID) { case 0: { - myCash=3000; + myCash=2000; } break; case 1: { - myCash=3000; + myCash=0; } break; case 2: { - myCash=3000; + myCash=0; } break; case 3: { - myCash=3000; + myCash=0; } break; case 4: { - myCash=3000; + myCash=0; } break; case 5: { - myCash=3000; + myCash=0; } break; case 6: { - myCash=3000; + myCash=1500; } break; default: { } @@ -1372,7 +1372,7 @@ void LocalPlayer::preflopEngine() { break; case 6: { // if(mySet == 160) { - myAction = PLAYER_ACTION_FOLD; + myAction = PLAYER_ACTION_CALL; // } } break;