mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 07:22:03 +00:00
Doing one more step to totally ensure that matchesplayed is unlocking stuff
This commit is contained in:
parent
a10a068f15
commit
7516a1dc0c
11 changed files with 26 additions and 23 deletions
|
@ -3082,7 +3082,7 @@ static void readmaincfg(MYFILE *f)
|
|||
if (!GoodDataFileName(word2))
|
||||
I_Error("Maincfg: bad data file name '%s'\n", word2);
|
||||
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
DEH_WriteUndoline(word, gamedatafilename, UNDO_NONE);
|
||||
strlcpy(gamedatafilename, word2, sizeof (gamedatafilename));
|
||||
strlwr(gamedatafilename);
|
||||
|
|
|
@ -775,10 +775,10 @@ void F_GameEvaluationDrawer(void)
|
|||
/*if (ultimatemode)
|
||||
++timesBeatenUltimate;*/
|
||||
|
||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(false))
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2259,10 +2259,10 @@ static inline void G_PlayerFinishLevel(INT32 player)
|
|||
if (legitimateexit && !demoplayback) // (yes you're allowed to unlock stuff this way when the game is modified)
|
||||
{
|
||||
matchesplayed++;
|
||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(true))
|
||||
{
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
G_SaveGameData(); // only save if unlocked something
|
||||
G_SaveGameData(true); // only save if unlocked something
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3643,7 +3643,7 @@ void G_LoadGameData(void)
|
|||
|
||||
// G_SaveGameData
|
||||
// Saves the main data file, which stores information such as emblems found, etc.
|
||||
void G_SaveGameData(void)
|
||||
void G_SaveGameData(boolean force)
|
||||
{
|
||||
size_t length;
|
||||
INT32 i, j;
|
||||
|
@ -3661,7 +3661,8 @@ void G_SaveGameData(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (modifiedgame && !savemoddata)
|
||||
if (modifiedgame && !savemoddata
|
||||
&& !force) // SRB2Kart: for enabling unlocks online in modified servers
|
||||
{
|
||||
free(savebuffer);
|
||||
save_p = savebuffer = NULL;
|
||||
|
|
|
@ -127,7 +127,7 @@ void G_DeferedPlayDemo(const char *demo);
|
|||
// Can be called by the startup code or M_Responder, calls P_SetupLevel.
|
||||
void G_LoadGame(UINT32 slot, INT16 mapoverride);
|
||||
|
||||
void G_SaveGameData(void);
|
||||
void G_SaveGameData(boolean force);
|
||||
|
||||
void G_SaveGame(UINT32 slot);
|
||||
|
||||
|
|
|
@ -295,13 +295,14 @@ void M_CheckUnlockConditions(void)
|
|||
}
|
||||
}
|
||||
|
||||
UINT8 M_UpdateUnlockablesAndExtraEmblems(void)
|
||||
UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force)
|
||||
{
|
||||
INT32 i;
|
||||
char cechoText[992] = "";
|
||||
UINT8 cechoLines = 0;
|
||||
|
||||
if (modifiedgame && !savemoddata)
|
||||
if (modifiedgame && !savemoddata
|
||||
&& !force) // SRB2Kart: for enabling unlocks online in modified servers
|
||||
return false;
|
||||
|
||||
M_CheckUnlockConditions();
|
||||
|
|
|
@ -152,7 +152,7 @@ void M_ClearSecrets(void);
|
|||
// Updating conditions and unlockables
|
||||
void M_CheckUnlockConditions(void);
|
||||
UINT8 M_CheckCondition(condition_t *cn);
|
||||
UINT8 M_UpdateUnlockablesAndExtraEmblems(void);
|
||||
UINT8 M_UpdateUnlockablesAndExtraEmblems(boolean force);
|
||||
void M_SilentUpdateUnlockablesAndEmblems(void);
|
||||
UINT8 M_CheckLevelEmblems(void);
|
||||
|
||||
|
|
|
@ -607,9 +607,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
return;
|
||||
emblemlocations[special->health-1].collected = true;
|
||||
|
||||
M_UpdateUnlockablesAndExtraEmblems();
|
||||
M_UpdateUnlockablesAndExtraEmblems(false);
|
||||
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -3015,10 +3015,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
unlocktriggers |= 1 << trigid;
|
||||
|
||||
// Unlocked something?
|
||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(false))
|
||||
{
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
G_SaveGameData(); // only save if unlocked something
|
||||
G_SaveGameData(false); // only save if unlocked something
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1650,7 +1650,7 @@ void P_DoPlayerExit(player_t *player)
|
|||
|| (splitscreen && player == &players[secondarydisplayplayer])
|
||||
|| (splitscreen > 1 && player == &players[thirddisplayplayer])
|
||||
|| (splitscreen > 2 && player == &players[fourthdisplayplayer]))
|
||||
&& (!player->spectator && ((!modifiedgame || savemoddata) && !demoplayback)))
|
||||
&& (!player->spectator && !demoplayback))
|
||||
legitimateexit = true;
|
||||
|
||||
if (G_RaceGametype()) // If in Race Mode, allow
|
||||
|
@ -9286,6 +9286,7 @@ void P_PlayerThink(player_t *player)
|
|||
CONS_Printf(M_GetText("%s ran out of time.\n"), player_names[player-players]);
|
||||
|
||||
player->pflags |= PF_TIMEOVER;
|
||||
legitimateexit = true; // SRB2kart: losing a race is still seeing it through to the end :p
|
||||
|
||||
if (player->pflags & PF_NIGHTSMODE)
|
||||
{
|
||||
|
|
|
@ -2770,7 +2770,7 @@ void I_Quit(void)
|
|||
#ifndef NONET
|
||||
D_SaveBan(); // save the ban list
|
||||
#endif
|
||||
G_SaveGameData(); // Tails 12-08-2002
|
||||
G_SaveGameData(false); // Tails 12-08-2002
|
||||
//added:16-02-98: when recording a demo, should exit using 'q' key,
|
||||
// but sometimes we forget and use 'F10'.. so save here too.
|
||||
|
||||
|
@ -2853,7 +2853,7 @@ void I_Error(const char *error, ...)
|
|||
if (errorcount == 9)
|
||||
{
|
||||
M_SaveConfig(NULL);
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
}
|
||||
if (errorcount > 20)
|
||||
{
|
||||
|
@ -2887,7 +2887,7 @@ void I_Error(const char *error, ...)
|
|||
#ifndef NONET
|
||||
D_SaveBan(); // save the ban list
|
||||
#endif
|
||||
G_SaveGameData(); // Tails 12-08-2002
|
||||
G_SaveGameData(false); // Tails 12-08-2002
|
||||
|
||||
// Shutdown. Here might be other errors.
|
||||
if (demorecording)
|
||||
|
|
|
@ -781,10 +781,10 @@ void Y_Ticker(void)
|
|||
// Update when done with tally
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && !demoplayback)
|
||||
{
|
||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(false))
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
}
|
||||
}
|
||||
else if (!(intertic & 1))
|
||||
|
@ -848,10 +848,10 @@ void Y_Ticker(void)
|
|||
// Update when done with tally
|
||||
if ((!modifiedgame || savemoddata) && !(netgame || multiplayer) && !demoplayback)
|
||||
{
|
||||
if (M_UpdateUnlockablesAndExtraEmblems())
|
||||
if (M_UpdateUnlockablesAndExtraEmblems(false))
|
||||
S_StartSound(NULL, sfx_ncitem);
|
||||
|
||||
G_SaveGameData();
|
||||
G_SaveGameData(false);
|
||||
}
|
||||
}
|
||||
else if (!(intertic & 1))
|
||||
|
|
Loading…
Reference in a new issue