From b1b23da51b73cb4ec82e4053c18f1ac672d7d859 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 25 Jun 2023 20:28:28 +0100 Subject: [PATCH] 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. --- src/g_game.c | 3 ++- src/p_saveg.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index ee4125077..47ae6479f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -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(); diff --git a/src/p_saveg.c b/src/p_saveg.c index 124285bd1..57b7e140f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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);