fixed playing "game.losing" sound also if not asking to play again
authorHolger Schemel <info@artsoft.org>
Tue, 21 Mar 2023 04:43:41 +0000 (05:43 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 21 Mar 2023 04:44:10 +0000 (05:44 +0100)
src/game.c
src/screens.c

index d91d8ac3ec629de5625ce29485531dba7c64bfa9..1cbea93f65185b803d2d0c6087be03a9227e3c9b 100644 (file)
@@ -15711,6 +15711,10 @@ void CheckGameOver(void)
     return;
   }
 
+  // do not ask to play again if this was disabled in setup menu
+  if (!setup.ask_on_game_over)
+    return;
+
   if (last_game_over != game_over)
     game.restart_game_message = getRestartGameMessage();
 
index 4d8f50e0e256c800e07db644618a960bec7ab1ce..eecb688b937aa681e9f1d78ab93e24de931a1ba0 100644 (file)
@@ -9527,8 +9527,7 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
 
 void HandleGameActions(void)
 {
-  if (setup.ask_on_game_over)
-    CheckGameOver();
+  CheckGameOver();
 
   if (game.restart_game_message != NULL)
   {