bugfix: wrong blinds in heads up
This commit is contained in:
@@ -203,18 +203,46 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
//Aktive Spieler zählen
|
||||||
|
int activePlayersCounter = 0;
|
||||||
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
if (playerArray[i]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
|
}
|
||||||
|
|
||||||
// alle Buttons loeschen
|
// alle Buttons loeschen
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { playerArray[i]->setMyButton(0); }
|
||||||
|
|
||||||
// DealerButton zuweisen
|
// DealerButton zuweisen
|
||||||
playerArray[dealerPosition]->setMyButton(1);
|
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;
|
i = dealerPosition;
|
||||||
do {
|
do {
|
||||||
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
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; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
|
||||||
|
if(playerArray[i]->getMyButton() == 2) {
|
||||||
|
//small blind
|
||||||
// mit SmallBlind All In ?
|
// mit SmallBlind All In ?
|
||||||
if(playerArray[i]->getMyCash() <= smallBlind) {
|
if(playerArray[i]->getMyCash() <= smallBlind) {
|
||||||
|
|
||||||
@@ -223,18 +251,11 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// sonst
|
// sonst
|
||||||
else {
|
else { playerArray[i]->setMySet(smallBlind); }
|
||||||
playerArray[i]->setMySet(smallBlind);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while(!(playerArray[i]->getMyActiveStatus()));
|
if(playerArray[i]->getMyButton() == 3) {
|
||||||
|
//big blind
|
||||||
// Big Blind zuweisen
|
|
||||||
do {
|
|
||||||
i = (i+1)%(MAX_NUMBER_OF_PLAYERS);
|
|
||||||
if(playerArray[i]->getMyActiveStatus()) {
|
|
||||||
playerArray[i]->setMyButton(3);
|
|
||||||
// mit BigBlind All In ?
|
// mit BigBlind All In ?
|
||||||
if(playerArray[i]->getMyCash() <= 2*smallBlind) {
|
if(playerArray[i]->getMyCash() <= 2*smallBlind) {
|
||||||
|
|
||||||
@@ -243,12 +264,9 @@ void LocalHand::assignButtons() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// sonst
|
// sonst
|
||||||
else {
|
else { playerArray[i]->setMySet(2*smallBlind); }
|
||||||
playerArray[i]->setMySet(2*smallBlind);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} while(!(playerArray[i]->getMyActiveStatus()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
||||||
if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
//print cash only for active players
|
//print cash only for active players
|
||||||
if(currentHand->getPlayerArray()[i]->getMyButton() == 3) {
|
if(currentHand->getPlayerArray()[i]->getMyButton() == 2) {
|
||||||
if(k==1) { logFileStreamString += ", "; }
|
if(k==1) { logFileStreamString += ", "; }
|
||||||
k=1;
|
k=1;
|
||||||
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
@@ -203,10 +203,6 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||||
if (currentHand->getPlayerArray()[k]->getMyAction() != 1 && currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
if (currentHand->getPlayerArray()[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()) {
|
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)+"$), ";
|
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)+"$), ";
|
||||||
|
|||||||
@@ -864,11 +864,17 @@ void mainWindowImpl::refreshButton() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (currentHand->getPlayerArray()[i]->getMyButton()==3) {
|
switch (currentHand->getPlayerArray()[i]->getMyButton()) {
|
||||||
buttonLabelArray[i]->setPixmap(dealerButton);
|
|
||||||
}
|
case 2 : buttonLabelArray[i]->setPixmap(dealerButton);
|
||||||
else {
|
break;
|
||||||
buttonLabelArray[i]->setPixmap(onePix);
|
case 3 : {
|
||||||
|
if (myConfig->readConfigInt("ShowBlindButtons")) buttonLabelArray[i]->setPixmap(bigblindButton);
|
||||||
|
else { buttonLabelArray[i]->setPixmap(onePix); }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: buttonLabelArray[i]->setPixmap(onePix);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user