G_DoCompleted: Gamedata-handling updates

- Don't give Chao Keys, roundsplayed for failing a round in time attack modes (Prison Break/SPB Attack/Special Mode)
- Always defer a save, since playtime is constantly incremented over the course of the round and may not be saved with crashes at certain points
This commit is contained in:
toaster 2023-12-28 16:25:54 +00:00
parent 57724baf9f
commit 6b984eab55

View file

@ -4158,7 +4158,10 @@ static void G_DoCompleted(void)
// Then, do gamedata-relevant material. // Then, do gamedata-relevant material.
// This has to be done second because some Challenges // This has to be done second because some Challenges
// are dependent on round standings. // are dependent on round standings.
if (legitimateexit && !demo.playback && !mapreset) if (legitimateexit && !demo.playback && !mapreset
&& ((modeattacking == ATTACKING_NONE)
|| !(players[consoleplayer].pflags & PF_NOCONTEST))
)
{ {
if (gametype != GT_TUTORIAL) if (gametype != GT_TUTORIAL)
{ {
@ -4174,11 +4177,12 @@ static void G_DoCompleted(void)
gamedata->roundsplayed[roundtype]++; gamedata->roundsplayed[roundtype]++;
} }
gamedata->pendingkeyrounds++; gamedata->pendingkeyrounds++;
M_UpdateUnlockablesAndExtraEmblems(true, true);
gamedata->deferredsave = true;
} }
M_UpdateUnlockablesAndExtraEmblems(true, true);
// eh, why not always save? makes sure playtime is never lost
gamedata->deferredsave = true;
// Then, update some important game state. // Then, update some important game state.
{ {
legitimateexit = false; legitimateexit = false;