From 66c415ea41e5b16323e3e1224b601a4f4a349b99 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 6 Oct 2023 19:09:51 +0100 Subject: [PATCH] Emblem system, Spray Cans: prevent Exiting players from grabbing them Fixes an issue that as far as the author of this commit is aware was only reported on Discord --- src/p_inter.c | 21 ++++++++++++++++++--- src/p_mobj.c | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index badd6d3a3..b76d4e4af 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -201,10 +201,19 @@ boolean P_CanPickupEmblem(player_t *player, INT32 emblemID) return false; } - if (player->bot) + if (player != NULL) { - // Your nefarious opponent puppy can't grab these for you. - return false; + if (player->bot) + { + // Your nefarious opponent puppy can't grab these for you. + return false; + } + + if (player->exiting) + { + // Yeah but YOU didn't actually do it now did you + return false; + } } return true; @@ -680,6 +689,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; } + if (player->exiting) + { + // Yeah but YOU didn't actually do it now did you + return; + } + if (!P_IsLocalPlayer(player)) { // Must be party. diff --git a/src/p_mobj.c b/src/p_mobj.c index eb82c9815..349831a23 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7230,7 +7230,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->frame &= ~FF_TRANSMASK; mobj->renderflags &= ~RF_TRANSMASK; - if (P_EmblemWasCollected(mobj->health - 1) || !P_CanPickupEmblem(&players[consoleplayer], mobj->health - 1)) + if (P_EmblemWasCollected(mobj->health - 1) || !P_CanPickupEmblem(NULL, mobj->health - 1)) { trans = tr_trans50; }