From c4e1a98e6b48fd06ad21932ba21e17a1c1983fc8 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 16 Nov 2023 13:58:06 -0700 Subject: [PATCH] Fix tournament mode cheat saving --- src/g_game.c | 4 ++++ src/m_cheat.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index c66923d2a..9aa814730 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5546,6 +5546,10 @@ void G_SaveGameData(void) // Also save profiles here. PR_SaveProfiles(); + + #ifdef DEVELOP + CONS_Alert(CONS_NOTICE, M_GetText("Gamedata saved.\n")); + #endif } #define VERSIONSIZE 16 diff --git a/src/m_cheat.c b/src/m_cheat.c index e91e445fd..24a0d26fd 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -80,13 +80,17 @@ static UINT8 cheatf_warp(void) } } + // Goofy, but this call needs to be before M_ClearMenus because that path + // calls G_LoadLevel, which will trigger a gamedata save. Garbage factory + if (success) + G_SetUsedCheats(); + M_ClearMenus(true); const char *text; if (success) { - G_SetUsedCheats(); S_StartSound(0, sfx_kc42); text = M_GetText(