From 0f141e1475c7900499ba75bf5829c96c06bd1820 Mon Sep 17 00:00:00 2001 From: sherl Date: Tue, 28 Jan 2025 13:37:09 +0100 Subject: [PATCH] take the pawns at home into account when deciding if the user can choose a pawn --- Chinczyk188/Engine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Chinczyk188/Engine.cpp b/Chinczyk188/Engine.cpp index 1f9743f..869b0d2 100644 --- a/Chinczyk188/Engine.cpp +++ b/Chinczyk188/Engine.cpp @@ -89,7 +89,7 @@ void Engine::nextTurn() { std::string choice; bool pawnMoved = false; - switch (currentPlayer.pawnsActive) { + switch (currentPlayer.pawnsActive + currentPlayer.pawnsAtHome) { // 0 pionków na planszy - musi wyjść pionkiem case 0: @@ -147,13 +147,13 @@ void Engine::nextTurn() { this->pawnmoveBuffer.play(); this->board.smartSleep(2000); break; - } else { - std::cout << "Ups! Nie mozesz tego zrobic!\n"; - std::cout << "Jedyna opcja to zagranie kolejnym pionkiem.\n"; + } else { + std::cout << "Ups! Nie mozesz tego zrobic!\n"; + std::cout << "Jedyna opcja to zagranie kolejnym pionkiem.\n"; this->invalidBuffer.play(); this->board.smartSleep(1000); - // Zróbmy to, co w a) - pickAPlace = false; + // Zróbmy to, co w a) + pickAPlace = false; std::cout << currentPlayer.getName() << " wychodzi " << currentPlayer.pawnsActive + 1 << ". pionkiem z bazy.\n"; // Rusz pierwszy możliwy pionek w bazie: