From a0e78485dfebb473c37d3866ed10955e0415cbed Mon Sep 17 00:00:00 2001 From: floty Date: Fri, 31 Aug 2007 13:09:07 +0000 Subject: [PATCH] bugfix: allin-bug --- pokerth_game.pro | 4 ++-- pokerth_lib.pro | 4 ++-- pokerth_server.pro | 4 ++-- src/engine/local_engine/localbero.cpp | 8 +++++++- src/engine/local_engine/localhand.cpp | 4 ---- src/gui/qt/mainwindow/mainwindowimpl.cpp | 7 +++++-- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/pokerth_game.pro b/pokerth_game.pro index f8984909..cc14738f 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -3,8 +3,8 @@ TEMPLATE = app CODECFORSRC = UTF-8 -CONFIG += qt thread embed_manifest_exe release -#CONFIG += qt thread embed_manifest_exe warn_on debug +#CONFIG += qt thread embed_manifest_exe release +CONFIG += qt thread embed_manifest_exe warn_on debug UI_DIR = uics MOC_DIR = mocs OBJECTS_DIR = obj diff --git a/pokerth_lib.pro b/pokerth_lib.pro index 5d15e709..b12d7052 100644 --- a/pokerth_lib.pro +++ b/pokerth_lib.pro @@ -178,8 +178,8 @@ mac{ INCLUDEPATH += /Library/Frameworks/SDL_mixer.framework/Headers } -CONFIG += staticlib qt thread release -#CONFIG += staticlib qt thread warn_on debug +#CONFIG += staticlib qt thread release +CONFIG += staticlib qt thread warn_on debug UI_DIR = uics TARGET = lib/pokerth_lib MOC_DIR = mocs diff --git a/pokerth_server.pro b/pokerth_server.pro index f493553d..a38ecc32 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -128,8 +128,8 @@ unix:!mac{ #LIBS += -lcrypto } -CONFIG += qt thread console embed_manifest_exe release -#CONFIG += qt thread console embed_manifest_exe warn_on debug +#CONFIG += qt thread console embed_manifest_exe release +CONFIG += qt thread console embed_manifest_exe warn_on debug UI_DIR = uics TARGET = bin/pokerth_server MOC_DIR = mocs diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index 2d04a6b8..4478ca26 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -63,6 +63,7 @@ void LocalBeRo::run() { break; case GAME_STATE_RIVER: myHand->getGuiInterface()->logDealBoardCardsMsg(myBeRoID, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]); break; + default: { cout << "ERROR in localbero.cpp - wrong myBeRoID" << endl;} } logBoardCardsDone = 1; @@ -107,7 +108,9 @@ void LocalBeRo::run() { myHand->setBettingRoundsPlayed(myBeRoID); } - if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpRound == 1) ) { + //// !!!!!!!!!!!!! very buggy, rule breaking -> TODO !!!!!!!!!!!!!!!! ////////////// + + if( !(myHand->getActualQuantityPlayers() < 3 && firstHeadsUpRound == 1) || myHand->getPlayerArray()[playersTurn]->getMyActiveStatus() == 0 ) { // not first round in heads up (for headsup dealer is smallblind so it is dealers turn) // naechsten Spieler ermitteln @@ -115,9 +118,12 @@ void LocalBeRo::run() { for(i=0; (igetPlayerArray()[playersTurn]->getMyActiveStatus()) || (myHand->getPlayerArray()[playersTurn]->getMyAction())==1 || (myHand->getPlayerArray()[playersTurn]->getMyAction())==6) || i==0; i++) { playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS); } + firstHeadsUpRound = 0; } else { firstHeadsUpRound = 0; } + ////// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //////////////// + //Spieler-Position vor SmallBlind-Position ermitteln int activePlayerBeforeSmallBlind = smallBlindPosition; diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 9509c27a..2e9b4363 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -37,7 +37,6 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI myBoard->setHand(this); - for(i=0; isetHand(this); // myFlipCards auf 0 setzen @@ -173,9 +172,6 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, BoardI // for(i=0; i<4; i++) { // cout << i << ": " << playerArray[i]->getMyCardsValueInt() << endl; // } - - - dealerPosition = 2; } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 842fb245..8c225966 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -742,6 +742,9 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) { int tmpDealerPos = 0; startData.numberOfPlayers = gameData.maxNumberOfPlayers; Tools::getRandNumber(0, startData.numberOfPlayers-1, 1, &tmpDealerPos, 0); + if(DEBUG_MODE) { + tmpDealerPos = 2; + } startData.startDealerPlayerId = static_cast(tmpDealerPos); //some gui modifications @@ -1407,7 +1410,7 @@ void mainWindowImpl::dealBeRoCards(int myBeRoID) { break; case 3: { dealRiverCards0(); } break; - default: { cout << "dealBeRoCards Error" << endl; } + default: { cout << "dealBeRoCards() Error" << endl; } } } @@ -1897,7 +1900,7 @@ void mainWindowImpl::beRoAnimation2(int myBeRoID) { break; case 3: { riverAnimation2(); } break; - default: { cout << "beRoAnimation2 Error" << endl; } + default: { cout << "beRoAnimation2() Error" << endl; } } }