From c72fcca57e150903aac40c06160c02b24626e962 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 25 Oct 2023 17:45:58 +0100 Subject: [PATCH] Adjust the circumstances players can get lives in GP contexts - Permit awarding in A_ForceWin - Set var1 to 1 to do so - More tightly restrict against awarding in GPEVENT_SPECIAL specifically --- src/p_enemy.c | 6 ++++-- src/p_inter.c | 2 +- src/p_user.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 81cd6c517..c0190c71b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -9232,12 +9232,14 @@ void A_ForceStop(mobj_t *actor) // // Description: Makes all players win the level. // -// var1 = unused +// var1: +// if var1 == 1, give a life in GP contexts // var2 = unused // void A_ForceWin(mobj_t *actor) { INT32 i; + INT32 locvar1 = var1; if (LUA_CallAction(A_FORCEWIN, actor)) return; @@ -9252,7 +9254,7 @@ void A_ForceWin(mobj_t *actor) if (i == MAXPLAYERS) return; - P_DoAllPlayersExit(0, false); + P_DoAllPlayersExit(0, (locvar1 == 1)); } // Function: A_SpikeRetract diff --git a/src/p_inter.c b/src/p_inter.c index 3c12d2fd8..8839d247d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1080,7 +1080,7 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source) if (++numtargets >= maptargets) { - P_DoAllPlayersExit(0, (grandprixinfo.gp == true)); + P_DoAllPlayersExit(0, true); } else { diff --git a/src/p_user.c b/src/p_user.c index fbe435952..ac159ba4d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1296,7 +1296,7 @@ void P_DoPlayerExit(player_t *player, pflags_t flags) player->hudrings = 20; if (grandprixinfo.gp == true - && grandprixinfo.eventmode == GPEVENT_NONE + && grandprixinfo.eventmode != GPEVENT_SPECIAL && player->bot == false && losing == false) { const UINT8 lifethreshold = 20; @@ -1365,6 +1365,7 @@ void P_DoAllPlayersExit(pflags_t flags, boolean trygivelife) const boolean dofinishsound = (musiccountdown == 0); if (grandprixinfo.gp == false + || grandprixinfo.eventmode == GPEVENT_SPECIAL || (flags & PF_NOCONTEST)) { trygivelife = false;