diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index 2c25b90b..b05adf2a 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -203,18 +203,46 @@ void LocalHand::assignButtons() { int i; + //Aktive Spieler zählen + int activePlayersCounter = 0; + for (i=0; igetMyActiveStatus() == 1) activePlayersCounter++; + } + // alle Buttons loeschen for (i=0; isetMyButton(0); } // DealerButton zuweisen playerArray[dealerPosition]->setMyButton(1); - // Small Blind zuweisen und setzen + // assign Small Blind next to dealer. ATTENTION: in heads up it is big blind i = dealerPosition; do { i = (i+1)%(MAX_NUMBER_OF_PLAYERS); if(playerArray[i]->getMyActiveStatus()) { - playerArray[i]->setMyButton(2); + if(activePlayersCounter > 2) playerArray[i]->setMyButton(2); //small blind normal + else playerArray[i]->setMyButton(3); //big blind in heads up + + } + + } while(!(playerArray[i]->getMyActiveStatus())); + + // assign big blind next to small blind. ATTENTION: in heads up it is small blind + do { + i = (i+1)%(MAX_NUMBER_OF_PLAYERS); + if(playerArray[i]->getMyActiveStatus()) { + if(activePlayersCounter > 2) playerArray[i]->setMyButton(3); //big blind normal + else playerArray[i]->setMyButton(2); //small blind in heads up + + } + + } while(!(playerArray[i]->getMyActiveStatus())); + + //do sets + for (i=0; igetMyButton() == 2) { + //small blind // mit SmallBlind All In ? if(playerArray[i]->getMyCash() <= smallBlind) { @@ -223,18 +251,11 @@ void LocalHand::assignButtons() { } // sonst - else { - playerArray[i]->setMySet(smallBlind); - } - } + else { playerArray[i]->setMySet(smallBlind); } + } - } while(!(playerArray[i]->getMyActiveStatus())); - - // Big Blind zuweisen - do { - i = (i+1)%(MAX_NUMBER_OF_PLAYERS); - if(playerArray[i]->getMyActiveStatus()) { - playerArray[i]->setMyButton(3); + if(playerArray[i]->getMyButton() == 3) { + //big blind // mit BigBlind All In ? if(playerArray[i]->getMyCash() <= 2*smallBlind) { @@ -243,12 +264,9 @@ void LocalHand::assignButtons() { } // sonst - else { - playerArray[i]->setMySet(2*smallBlind); - } + else { playerArray[i]->setMySet(2*smallBlind); } } - - } while(!(playerArray[i]->getMyActiveStatus())); + } } diff --git a/src/gui/qt/log/log.cpp b/src/gui/qt/log/log.cpp index ffedf293..0aa634f4 100644 --- a/src/gui/qt/log/log.cpp +++ b/src/gui/qt/log/log.cpp @@ -181,7 +181,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) { for(i=0; igetStartQuantityPlayers(); i++) { if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) { //print cash only for active players - if(currentHand->getPlayerArray()[i]->getMyButton() == 3) { + if(currentHand->getPlayerArray()[i]->getMyButton() == 2) { if(k==1) { logFileStreamString += ", "; } k=1; logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$"; @@ -203,18 +203,14 @@ void Log::logNewGameHandMsg(int gameID, int handID) { for (k=0; kgetPlayerArray()[k]->getMyAction() != 1 && currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++; } - if(activePlayersCounter < 3) { j=1; } - - // cout << activePlayersCounter << endl; - // cout << (i+currentHand->getDealerPosition()+j)%5 << endl; - + switch (currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyButton()) { case 2 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$), "; break; case 3 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$)"; break; default :; - } + } } logFileStreamString += "

PREFLOP"; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index ce2ecc7c..927bea7d 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -864,11 +864,17 @@ void mainWindowImpl::refreshButton() { } } else { - if (currentHand->getPlayerArray()[i]->getMyButton()==3) { - buttonLabelArray[i]->setPixmap(dealerButton); - } - else { - buttonLabelArray[i]->setPixmap(onePix); + switch (currentHand->getPlayerArray()[i]->getMyButton()) { + + case 2 : buttonLabelArray[i]->setPixmap(dealerButton); + break; + case 3 : { + if (myConfig->readConfigInt("ShowBlindButtons")) buttonLabelArray[i]->setPixmap(bigblindButton); + else { buttonLabelArray[i]->setPixmap(onePix); } + } + break; + default: buttonLabelArray[i]->setPixmap(onePix); + } } }