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
This commit is contained in:
toaster 2023-10-06 19:09:51 +01:00
parent 14b6c0f275
commit 66c415ea41
2 changed files with 19 additions and 4 deletions

View file

@ -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.

View file

@ -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;
}