From bb7c217ccc63ea26c3b42e573e67fedac19ac905 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 13 Jan 2025 16:37:56 +0100 Subject: [PATCH] remove "majormods" checks from stuff that saves to savegame so its only there to throw a notice when you load an addon --- src/d_netcmd.c | 8 ++------ src/g_game.c | 12 +++--------- src/m_cond.c | 4 +--- src/m_menu.c | 11 ----------- src/p_setup.c | 4 ++-- src/y_inter.c | 2 +- 6 files changed, 9 insertions(+), 32 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b01f87e5a..3a2b90369 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5801,12 +5801,8 @@ static void Fishcake_OnChange(void) */ static void Command_Isgamemodified_f(void) { - if (majormods) - CONS_Printf("The game has been modified with major addons, so you cannot play Record Attack.\n"); - else if (savemoddata) - CONS_Printf("The game has been modified with an addon with its own save data, so you can play Record Attack and earn medals.\n"); - else if (modifiedgame) - CONS_Printf("The game has been modified with only minor addons. You can play Record Attack, earn medals and unlock extras.\n"); + if (majormods || modifiedgame) + CONS_Printf("The game has been modified, Record Attack data will be saved to a seperate savegame.\n"); else CONS_Printf("The game has not been modified. You can play Record Attack, earn medals and unlock extras.\n"); } diff --git a/src/g_game.c b/src/g_game.c index 34c1463cc..76b837dcf 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -599,13 +599,12 @@ tic_t G_GetBestTime(INT16 map) return mainrecords[map-1]->time; } -// hack t +// kinda hacky way to do this, but this sets the game to use a seperate savefile if you have addons loaded static void G_SetSaveGameModified(void) { size_t filenamelen; savemoddata = true; - majormods = false; // FIXME: this breaks the menu warning screen from popping up, id still want to use it to mention the diff savefile strlcpy(gamedatafilename, "modkartdata.dat", sizeof (gamedatafilename)); strlwr(gamedatafilename); @@ -638,6 +637,7 @@ void G_SetGameModified(boolean silent, boolean major) //savemoddata = false; -- there is literally no reason to do this anymore. majormods = true; + // should this only be done when you load a "major" gameplay modifieng addon? G_SetSaveGameModified(); if (!silent) @@ -3635,6 +3635,7 @@ void G_SaveGameData(boolean force) INT32 i, j; UINT8 btemp; savebuffer_t save; + (void)force; if (!gamedataloaded) return; // If never loaded (-nodata), don't save @@ -3646,13 +3647,6 @@ void G_SaveGameData(boolean force) return; } - if (majormods && !force) - { - free(save.buffer); - save.p = save.buffer = NULL; - return; - } - // Version test WRITEUINT32(save.p, 0xFCAFE211); diff --git a/src/m_cond.c b/src/m_cond.c index fc33f36c6..f9d871969 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -385,9 +385,7 @@ UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force) INT32 i; char cechoText[992] = ""; UINT8 cechoLines = 0; - - if (majormods && !force) // SRB2Kart: for enabling unlocks online in modified servers - return false; + (void)force; M_CheckUnlockConditions(); diff --git a/src/m_menu.c b/src/m_menu.c index 36330f1b7..696cffbdd 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4100,17 +4100,6 @@ boolean M_Responder(event_t *ev) if (routine) { - if (((currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_CALL - || (currentMenu->menuitems[itemOn].status & IT_TYPE)==IT_SUBMENU) - && (currentMenu->menuitems[itemOn].status & IT_CALLTYPE)) - { - if (((currentMenu->menuitems[itemOn].status & IT_CALLTYPE) & IT_CALL_NOTMODIFIED) && majormods) - { - S_StartSound(NULL, sfx_menu1); - M_StartMessage(M_GetText("This cannot be done with complex addons\nor in a cheated game.\n\n(Press a key)\n"), NULL, MM_NOTHING); - return true; - } - } S_StartSound(NULL, sfx_menu1); switch (currentMenu->menuitems[itemOn].status & IT_TYPE) { diff --git a/src/p_setup.c b/src/p_setup.c index 3b2ed7714..362cd71d0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -988,7 +988,7 @@ static inline void P_SpawnEmblems(void) static void P_SpawnSecretItems(boolean loademblems) { // Now let's spawn those funky emblem things! Tails 12-08-2002 - if (netgame || multiplayer || majormods) // No cheating!! + if (netgame || multiplayer) // No cheating!! return; if (loademblems) @@ -2976,7 +2976,7 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate) nextmapoverride = 0; skipstats = false; - if (!(netgame || multiplayer) && !majormods) + if (!(netgame || multiplayer)) mapvisited[gamemap-1] |= MV_VISITED; levelloading = false; diff --git a/src/y_inter.c b/src/y_inter.c index 61f4a069b..cce19ad7f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -844,7 +844,7 @@ void Y_StartIntermission(void) } case int_race: // (time-only race) { - if (!majormods && !multiplayer && !demo.playback) // remove this once we have a proper time attack screen + if (!multiplayer && !demo.playback) // remove this once we have a proper time attack screen { // Update visitation flags mapvisited[gamemap-1] |= MV_BEATEN;