From 2d149c1256845bb4b305c927cd9d1068d1dbb77a Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Wed, 11 Oct 2023 10:22:06 +0200 Subject: [PATCH] Fixed a bug in the ttt-gui.cpp --- ttt-gui.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ttt-gui.cpp b/ttt-gui.cpp index b6b4f59..23a7f80 100644 --- a/ttt-gui.cpp +++ b/ttt-gui.cpp @@ -112,9 +112,8 @@ int main() { while (SDL_PollEvent(&event)) { if (playerWon("X") || playerWon("O")) state = 1; - if (event.type == SDL_QUIT) gameOpen = false; - if (event.type == SDL_MOUSEBUTTONUP) { + if (event.type == SDL_MOUSEBUTTONUP && state == 0) { int mouseX; int mouseY; SDL_GetMouseState(&mouseX, &mouseY);