Run QuitGame instead of DoSaveGame when quitting a game after pressing CTRL+Q (#388)

This commit is contained in:
Anonymous Maarten 2024-07-09 02:27:47 +02:00 committed by GitHub
parent 8751f63695
commit 3d67fd730d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 11 deletions

View File

@ -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"
@ -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)) {
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);
QuitGame();
}
gIn_check_quit = 0;
}
return 0;
return 1;
}
// IDA: double __cdecl sqr(double pN)