Skip to content

Commit

Permalink
Run QuitGame instead of DoSaveGame when quitting a game after pressin…
Browse files Browse the repository at this point in the history
…g CTRL+Q (#388)
  • Loading branch information
madebr authored Jul 9, 2024
1 parent 8751f63 commit 3d67fd7
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/DETHRACE/common/utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "input.h"
#include "loading.h"
#include "loadsave.h"
#include "main.h"
#include "mainmenu.h"
#include "network.h"
#include "pd/sys.h"
Expand Down Expand Up @@ -44,18 +45,22 @@ br_pixelmap* gSource_for_16bit_palette;
int CheckQuit(void) {
LOG_TRACE8("()");

if (!gIn_check_quit && KeyIsDown(KEYMAP_CTRL_QUIT) && KeyIsDown(KEYMAP_CONTROL_ANY)) {
gIn_check_quit = 1;
while (AnyKeyDown()) {
;
}
if (gIn_check_quit) {
return 0;
}
if (!KeyIsDown(KEYMAP_CTRL_QUIT) || !KeyIsDown(KEYMAP_CONTROL_ANY)) {
return 0;
}
gIn_check_quit = 1;
while (AnyKeyDown()) {
;
}

if (DoVerifyQuit(1)) {
DoSaveGame(1);
}
gIn_check_quit = 0;
if (DoVerifyQuit(1)) {
QuitGame();
}
return 0;
gIn_check_quit = 0;
return 1;
}

// IDA: double __cdecl sqr(double pN)
Expand Down

0 comments on commit 3d67fd7

Please sign in to comment.