mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-25 20:01:04 +00:00
* Did some reviewing, turns out there's literally no reason to disable savemoddata when majormods gets tripped and it's just a stupid thing vanilla did for modifiedgame for some reason that we almost inherited with our new solution?
* Adjusted the save system to acknowledge the new status quo. Instead of trying to save modifiedgame in the file like some sort of extremely boneheaded honour system everyone and their mothers hacks around, we just use it to determine whether the save is for a mod with savedata or not (this keeps backwards compatibility based on how we were using it, anyways, especially with the *force* parameter...) * Added a menu message for attempting to play a demo set on a map that isn't loaded, as opposed to letting it I_Error. * Minor tweaks to addons menu representing modded status.
This commit is contained in:
parent
ce09566e11
commit
ada4ce622f
3 changed files with 24 additions and 14 deletions
|
@ -4910,10 +4910,10 @@ static void Fishcake_OnChange(void)
|
||||||
*/
|
*/
|
||||||
static void Command_Isgamemodified_f(void)
|
static void Command_Isgamemodified_f(void)
|
||||||
{
|
{
|
||||||
if (savemoddata)
|
if (majormods)
|
||||||
CONS_Printf("The game has been modified with an add-on with its own save data, so you can play Record Attack and earn medals.\n");
|
|
||||||
else if (majormods)
|
|
||||||
CONS_Printf("The game has been modified with major add-ons, so you cannot play Record Attack.\n");
|
CONS_Printf("The game has been modified with major add-ons, so you cannot play Record Attack.\n");
|
||||||
|
else if (savemoddata)
|
||||||
|
CONS_Printf("The game has been modified with an add-on with its own save data, so you can play Record Attack and earn medals.\n");
|
||||||
else if (modifiedgame)
|
else if (modifiedgame)
|
||||||
CONS_Printf("The game has been modified with only minor add-ons. You can play Record Attack, earn medals and unlock extras.\n");
|
CONS_Printf("The game has been modified with only minor add-ons. You can play Record Attack, earn medals and unlock extras.\n");
|
||||||
else
|
else
|
||||||
|
|
25
src/g_game.c
25
src/g_game.c
|
@ -764,7 +764,7 @@ void G_SetGameModified(boolean silent, boolean major)
|
||||||
if (!major)
|
if (!major)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
savemoddata = false;
|
//savemoddata = false; -- there is literally no reason to do this anymore.
|
||||||
majormods = true;
|
majormods = true;
|
||||||
|
|
||||||
if (!silent)
|
if (!silent)
|
||||||
|
@ -3933,7 +3933,6 @@ void G_LoadGameData(void)
|
||||||
// Saves the main data file, which stores information such as emblems found, etc.
|
// Saves the main data file, which stores information such as emblems found, etc.
|
||||||
void G_SaveGameData(boolean force)
|
void G_SaveGameData(boolean force)
|
||||||
{
|
{
|
||||||
const boolean wasmodified = modifiedgame;
|
|
||||||
size_t length;
|
size_t length;
|
||||||
INT32 i, j;
|
INT32 i, j;
|
||||||
UINT8 btemp;
|
UINT8 btemp;
|
||||||
|
@ -3950,9 +3949,7 @@ void G_SaveGameData(boolean force)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified
|
if (majormods && !force)
|
||||||
modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@;
|
|
||||||
else if (modifiedgame && !savemoddata)
|
|
||||||
{
|
{
|
||||||
free(savebuffer);
|
free(savebuffer);
|
||||||
save_p = savebuffer = NULL;
|
save_p = savebuffer = NULL;
|
||||||
|
@ -3965,7 +3962,7 @@ void G_SaveGameData(boolean force)
|
||||||
WRITEUINT32(save_p, totalplaytime);
|
WRITEUINT32(save_p, totalplaytime);
|
||||||
WRITEUINT32(save_p, matchesplayed);
|
WRITEUINT32(save_p, matchesplayed);
|
||||||
|
|
||||||
btemp = (UINT8)(savemoddata || modifiedgame);
|
btemp = (UINT8)(savemoddata); // what used to be here was profoundly dunderheaded
|
||||||
WRITEUINT8(save_p, btemp);
|
WRITEUINT8(save_p, btemp);
|
||||||
|
|
||||||
// TODO put another cipher on these things? meh, I don't care...
|
// TODO put another cipher on these things? meh, I don't care...
|
||||||
|
@ -4051,9 +4048,6 @@ void G_SaveGameData(boolean force)
|
||||||
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length);
|
FIL_WriteFile(va(pandf, srb2home, gamedatafilename), savebuffer, length);
|
||||||
free(savebuffer);
|
free(savebuffer);
|
||||||
save_p = savebuffer = NULL;
|
save_p = savebuffer = NULL;
|
||||||
|
|
||||||
if (force) // Eeeek, I'm sorry for my sins!
|
|
||||||
modifiedgame = wasmodified;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VERSIONSIZE 16
|
#define VERSIONSIZE 16
|
||||||
|
@ -5925,6 +5919,19 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ...*map* not loaded?
|
||||||
|
if (!gamemap || (gamemap > NUMMAPS) || !mapheaderinfo[gamemap-1] || !(mapheaderinfo[gamemap-1]->menuflags & LF2_EXISTSHACK))
|
||||||
|
{
|
||||||
|
snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname);
|
||||||
|
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||||
|
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||||
|
Z_Free(pdemoname);
|
||||||
|
Z_Free(demobuffer);
|
||||||
|
demoplayback = false;
|
||||||
|
titledemo = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Z_Free(pdemoname);
|
Z_Free(pdemoname);
|
||||||
|
|
||||||
memset(&oldcmd,0,sizeof(oldcmd));
|
memset(&oldcmd,0,sizeof(oldcmd));
|
||||||
|
|
|
@ -4543,7 +4543,10 @@ static boolean M_AddonsRefresh(void)
|
||||||
if ((refreshdirmenu & REFRESHDIR_NORMAL) && !preparefilemenu(true))
|
if ((refreshdirmenu & REFRESHDIR_NORMAL) && !preparefilemenu(true))
|
||||||
{
|
{
|
||||||
UNEXIST;
|
UNEXIST;
|
||||||
|
if (refreshdirname)
|
||||||
|
{
|
||||||
CLEARNAME;
|
CLEARNAME;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4723,7 +4726,7 @@ static void M_DrawAddons(void)
|
||||||
V_DrawSmallScaledPatch(x, y + 4, (menusearch[0] ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+3]);
|
V_DrawSmallScaledPatch(x, y + 4, (menusearch[0] ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+3]);
|
||||||
|
|
||||||
x = BASEVIDWIDTH - x - 16;
|
x = BASEVIDWIDTH - x - 16;
|
||||||
V_DrawSmallScaledPatch(x, y + 4, ((!modifiedgame || savemoddata) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
|
V_DrawSmallScaledPatch(x, y + 4, ((!majormods) ? 0 : V_TRANSLUCENT), addonsp[NUM_EXT+4]);
|
||||||
|
|
||||||
if (modifiedgame)
|
if (modifiedgame)
|
||||||
V_DrawSmallScaledPatch(x, y + 4, 0, addonsp[NUM_EXT+2]);
|
V_DrawSmallScaledPatch(x, y + 4, 0, addonsp[NUM_EXT+2]);
|
||||||
|
|
Loading…
Reference in a new issue