diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index a54cc537..364d33b6 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -490,7 +490,7 @@ void LocalHand::setBlinds() (*it_c)->setMySet((*it_c)->getMyCash()); // 1 to do not log this - (*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1); + (*it_c)->setMyAction(PLAYER_ACTION_ALLIN); } else { (*it_c)->setMySet(smallBlind); @@ -510,7 +510,7 @@ void LocalHand::setBlinds() (*it_c)->setMySet((*it_c)->getMyCash()); // 1 to do not log this - (*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1); + (*it_c)->setMyAction(PLAYER_ACTION_ALLIN); } else { (*it_c)->setMySet(2*smallBlind); @@ -526,7 +526,7 @@ void LocalHand::switchRounds() // logging last player action PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID); if(previousPlayerIt != runningPlayerList->end()) { - if(myLog) myLog->logPlayerAction((*previousPlayerIt)->getMyName(),myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMySet()); + if(myLog) myLog->logPlayerAction((*previousPlayerIt)->getMyName(),myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMyLastRelativeSet()); } PlayerListIterator it, it_1; diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 34340e59..76bfb741 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -1068,7 +1068,7 @@ void LocalPlayer::action() //set that i was the last active player. need this for unhighlighting groupbox currentHand->setPreviousPlayerID(myID); - currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); + currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet); currentHand->getGuiInterface()->nextPlayerAnimation(); // cout << "playerID in action(): " << (*(currentHand->getCurrentBeRo()->getCurrentPlayersTurnIt()))->getMyID() << endl; @@ -3230,14 +3230,12 @@ void LocalPlayer::evaluation(int bet, int raise) case 3: { // all in if(highestSet >= myCash + mySet) { - mySet += myCash; - myCash = 0; + setMySet(myCash); myAction = PLAYER_ACTION_ALLIN; } // sonst else { - myCash = myCash - highestSet + mySet; - mySet = highestSet; + setMySet(highestSet-mySet); } } break; @@ -3250,16 +3248,14 @@ void LocalPlayer::evaluation(int bet, int raise) currentHand->getCurrentBeRo()->setFullBetRule(true); } currentHand->getCurrentBeRo()->setMinimumRaise(myCash); - mySet = myCash; - myCash = 0; + setMySet(myCash); myAction = PLAYER_ACTION_ALLIN; highestSet = mySet; } // sonst else { currentHand->getCurrentBeRo()->setMinimumRaise(bet); - myCash = myCash - bet; - mySet = bet; + setMySet(bet); highestSet = mySet; } @@ -3272,14 +3268,12 @@ void LocalPlayer::evaluation(int bet, int raise) if(currentHand->getCurrentBeRo()->getFullBetRule()) { // full bet rule -> only call possible // all in if(highestSet >= myCash + mySet) { - mySet += myCash; - myCash = 0; + setMySet(myCash); myAction = PLAYER_ACTION_ALLIN; } // sonst else { - myCash = myCash - highestSet + mySet; - mySet = highestSet; + setMySet(highestSet-mySet); myAction = PLAYER_ACTION_CALL; } } else { @@ -3292,8 +3286,7 @@ void LocalPlayer::evaluation(int bet, int raise) // perhaps full bet rule if(highestSet >= myCash + mySet) { // only call all-in - mySet += myCash; - myCash = 0; + setMySet(myCash); myAction = PLAYER_ACTION_ALLIN; } else { // raise, but not enough --> full bet rule @@ -3301,9 +3294,8 @@ void LocalPlayer::evaluation(int bet, int raise) // lastPlayerAction für Karten umblättern reihenfolge setzrn currentHand->setLastActionPlayerID(myUniqueID); - mySet += myCash; + setMySet(myCash); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); - myCash = 0; myAction = PLAYER_ACTION_ALLIN; highestSet = mySet; } @@ -3311,9 +3303,8 @@ void LocalPlayer::evaluation(int bet, int raise) // lastPlayerAction für Karten umblättern reihenfolge setzrn currentHand->setLastActionPlayerID(myUniqueID); - mySet += myCash; + setMySet(myCash); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); - myCash = 0; myAction = PLAYER_ACTION_ALLIN; highestSet = mySet; } @@ -3321,8 +3312,7 @@ void LocalPlayer::evaluation(int bet, int raise) // sonst else { currentHand->getCurrentBeRo()->setMinimumRaise(raise); - myCash = myCash + mySet - highestSet - raise; - mySet = highestSet + raise; + setMySet(highestSet+raise-mySet); highestSet = mySet; // lastPlayerAction für Karten umblättern reihenfolge setzrn currentHand->setLastActionPlayerID(myUniqueID); diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index a37c3fe7..ca98c608 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -113,10 +113,10 @@ public: return myLastRelativeSet; } - void setMyAction(PlayerAction theValue, bool blind = 0) { + void setMyAction(PlayerAction theValue, bool human = 0) { myAction = theValue; - // logging for human player - if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); + // logging for seat 0 + if(myAction && human) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet); } PlayerAction getMyAction() const { return myAction; diff --git a/src/engine/network_engine/clientplayer.cpp b/src/engine/network_engine/clientplayer.cpp index ba42368b..cfa13e6d 100644 --- a/src/engine/network_engine/clientplayer.cpp +++ b/src/engine/network_engine/clientplayer.cpp @@ -195,7 +195,7 @@ ClientPlayer::getMyLastRelativeSet() const } void -ClientPlayer::setMyAction(PlayerAction theValue, bool /*blind*/) +ClientPlayer::setMyAction(PlayerAction theValue, bool /*human*/) { boost::recursive_mutex::scoped_lock lock(m_syncMutex); myAction = theValue; diff --git a/src/engine/network_engine/clientplayer.h b/src/engine/network_engine/clientplayer.h index 1ccdc7a7..6b33d8db 100644 --- a/src/engine/network_engine/clientplayer.h +++ b/src/engine/network_engine/clientplayer.h @@ -64,7 +64,7 @@ public: int getMySet() const; int getMyLastRelativeSet() const; - void setMyAction(PlayerAction theValue, bool blind); + void setMyAction(PlayerAction theValue, bool human); PlayerAction getMyAction() const; void setMyButton(int theValue); diff --git a/src/engine/playerinterface.h b/src/engine/playerinterface.h index 533fc394..46a124ec 100644 --- a/src/engine/playerinterface.h +++ b/src/engine/playerinterface.h @@ -62,8 +62,8 @@ public: virtual int getMySet() const =0; virtual int getMyLastRelativeSet() const =0; - virtual void setMyAction(PlayerAction theValue, bool blind=0) =0; - virtual PlayerAction getMyAction() const =0; + virtual void setMyAction(PlayerAction theValue, bool human=0) =0; + virtual PlayerAction getMyAction() const =0; virtual void setMyButton(int theValue) =0; virtual int getMyButton() const =0; diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index cc232a24..9fc7c494 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -1990,7 +1990,7 @@ void gameTableImpl::myFold() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); - humanPlayer->setMyAction(PLAYER_ACTION_FOLD); + humanPlayer->setMyAction(PLAYER_ACTION_FOLD,true); humanPlayer->setMyTurn(0); //set that i was the last active player. need this for unhighlighting groupbox @@ -2009,7 +2009,7 @@ void gameTableImpl::myCheck() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); humanPlayer->setMyTurn(0); - humanPlayer->setMyAction(PLAYER_ACTION_CHECK); + humanPlayer->setMyAction(PLAYER_ACTION_CHECK,true); //set that i was the last active player. need this for unhighlighting groupbox currentHand->setPreviousPlayerID(0); @@ -2072,10 +2072,10 @@ void gameTableImpl::myCall() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); - humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); + humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true); } else { humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); - humanPlayer->setMyAction(PLAYER_ACTION_CALL); + humanPlayer->setMyAction(PLAYER_ACTION_CALL,true); } humanPlayer->setMyTurn(0); @@ -2108,7 +2108,7 @@ void gameTableImpl::mySet() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); - humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); + humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { @@ -2119,7 +2119,7 @@ void gameTableImpl::mySet() if(myActionIsRaise) { //do not if allIn if(humanPlayer->getMyAction() != 6) { - humanPlayer->setMyAction(PLAYER_ACTION_RAISE); + humanPlayer->setMyAction(PLAYER_ACTION_RAISE,true); } myActionIsRaise = 0; @@ -2129,7 +2129,7 @@ void gameTableImpl::mySet() if(myActionIsBet) { //do not if allIn if(humanPlayer->getMyAction() != 6) { - humanPlayer->setMyAction(PLAYER_ACTION_BET); + humanPlayer->setMyAction(PLAYER_ACTION_BET,true); } myActionIsBet = 0; @@ -2166,7 +2166,7 @@ void gameTableImpl::myAllIn() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); - humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); + humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { diff --git a/src/gui/qt/gametable/log/guilog.h b/src/gui/qt/gametable/log/guilog.h index e81c2e18..b3b5e861 100644 --- a/src/gui/qt/gametable/log/guilog.h +++ b/src/gui/qt/gametable/log/guilog.h @@ -21,9 +21,9 @@ #include #include #include +#include #include "configfile.h" -#include #include #include