Merge branch 'where-the-fuck-is-my-mobj-at' into 'next'

Add player mobj check to P_PlayerInPain (resolves #640)

Closes #640

See merge request STJr/SRB2!1587
This commit is contained in:
Tatsuru 2021-09-12 22:06:54 +00:00
commit 1875c0dc79

View file

@ -969,6 +969,9 @@ pflags_t P_GetJumpFlags(player_t *player)
// //
boolean P_PlayerInPain(player_t *player) boolean P_PlayerInPain(player_t *player)
{ {
// If the player doesn't have a mobj, it can't be in pain.
if (!player->mo)
return false;
// no silly, sliding isn't pain // no silly, sliding isn't pain
if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate] && player->powers[pw_flashing]) if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate] && player->powers[pw_flashing])
return true; return true;