Prevent game from closing whilst autosaving (#967)

This commit is contained in:
Hyper 2025-03-07 01:43:37 +00:00 committed by GitHub
parent 3676c28114
commit 676c3f0ff4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@ public:
static inline bool s_isInit;
static inline bool s_isMissingDLC;
static inline bool s_isLoading;
static inline bool s_isSaving;
static inline bool s_isWerehog;
static inline bool s_isSaveDataCorrupt;

View file

@ -97,6 +97,8 @@ PPC_FUNC(sub_824E5170)
__imp__sub_824E5170(ctx, base);
App::s_isSaving = pSaveIcon->m_IsVisible;
if (pSaveIcon->m_IsVisible)
{
App::s_isSaveDataCorrupt = false;

View file

@ -34,9 +34,15 @@ int Window_OnSDLEvent(void*, SDL_Event* event)
switch (event->type)
{
case SDL_QUIT:
App::Exit();
{
if (App::s_isSaving)
break;
App::Exit();
break;
}
case SDL_KEYDOWN:
{
switch (event->key.keysym.sym)