Prevent the other half of tape's exploit

Save one less life than you actually have, so you're discouraged from constantly reloading from backup.
This commit is contained in:
toaster 2023-06-25 20:28:28 +01:00
parent 87c26f0fe9
commit b1b23da51b
2 changed files with 4 additions and 2 deletions

View file

@ -4030,7 +4030,8 @@ void G_HandleSaveLevel(boolean removecondition)
|| roundqueue.size == 0)
return;
if (roundqueue.position == 1)
if (roundqueue.position == 1
|| players[consoleplayer].lives <= 1) // because a life is lost on reload
goto doremove;
G_SaveGame();

View file

@ -84,7 +84,8 @@ static inline void P_ArchivePlayer(savebuffer_t *save)
{
const player_t *player = &players[consoleplayer];
WRITESINT8(save->p, player->lives);
// Prevent an exploit from occuring.
WRITESINT8(save->p, (player->lives - 1));
WRITEUINT32(save->p, player->score);
WRITEUINT16(save->p, player->totalring);