From b6bc0d092fe2ab07c6aa1406781a13838714cdf2 Mon Sep 17 00:00:00 2001 From: dawidg81 Date: Wed, 28 Jan 2026 20:13:39 +0100 Subject: several fixes and successfull build --- src/Game.cpp | 6 +++--- src/Utils.cpp | 2 +- src/main.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Game.cpp b/src/Game.cpp index f869f51..be922c5 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -49,14 +49,14 @@ int Game::editDiff(){ std::cout << "Now editing custom difficulty" << std::endl; std::cout << "Board width: "; - if(util.catchReturn(util.catchInputInt(Game::boardWidth)) != 0) return 1; + if(util.catchReturn(util.catchInputInt(&boardWidth)) != 0) return 1; std::cout << Game::boardWidth; std::cout << "Board height: "; - if(util.catchReturn(util.catchInputInt(Game::boardHeight)) != 0) return 1; + if(util.catchReturn(util.catchInputInt(&boardHeight)) != 0) return 1; std::cout << "Mines: "; - if(util.catchReturn(util.catchInputInt(Game::mines)) != 0) return 1; + if(util.catchReturn(util.catchInputInt(&mines)) != 0) return 1; return 0; } diff --git a/src/Utils.cpp b/src/Utils.cpp index 37ebefe..b32b4e8 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -4,7 +4,7 @@ #include int Utils::catchInputInt(int* input){ - std::cin >> input; + std::cin >> *input; if (std::cin.fail()) { std::cout << "error: Input failed" << std::endl; diff --git a/src/main.cpp b/src/main.cpp index 3e1c1cc..88b8ffa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ #include -#include "Game/Game.hpp" +#include "Game.hpp" using namespace std; int main(){ -- cgit v1.2.3