From 8b231230a5d245c14e36ae116003ece8af50bdfe Mon Sep 17 00:00:00 2001 From: "S.Klapproth" <severikl@student.ethz.ch> Date: Thu, 26 May 2022 18:06:02 +0200 Subject: [PATCH] correction of wrong status messages --- source/client/panels/MainGamePanel.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/client/panels/MainGamePanel.cpp b/source/client/panels/MainGamePanel.cpp index bec05a2..227ca4d 100644 --- a/source/client/panels/MainGamePanel.cpp +++ b/source/client/panels/MainGamePanel.cpp @@ -141,8 +141,8 @@ void MainGamePanel::buildOthers(game_state* gameState, player* otherPlayer, doub std::string err; int pp = otherPlayer->get_hand()->get_points(err); int dp = gameState->get_dealers_hand()->get_points(err); - if(pp < dp) status_message += "LOST ROUND"; - else if(pp > dp) status_message += "WON ROUND"; + if(dp>21 || pp > dp ) status_message += "WON ROUND"; + else if(pp < dp) status_message += "LOST ROUND"; else status_message += "DRAW WITH DEALER"; } @@ -336,11 +336,12 @@ void MainGamePanel::buildThisPlayer(game_state* gameState, player* me) { int dp = gameState->get_dealers_hand()->get_points(err); if(me->get_hand()->is_over_21(err)) - status_message += "YOU LOST THIS ROUND"; - else if(pp < dp) status_message += "YOU LOST THIS ROUND"; - else if(pp > dp) status_message += "YOU WON THIS ROUND"; - else status_message += "YOU TIED WITH THE DEALER"; + status_message += "YOU LOST THIS ROUND"; + else if(dp>21 || pp > dp) status_message += "YOU WON THIS ROUND"; + else if(pp < dp) status_message += "YOU LOST THIS ROUND"; + else status_message += "YOU TIED WITH THE DEALER"; + wxStaticText *playerStatus = buildStaticText( status_message, wxDefaultPosition, -- GitLab