summaryrefslogtreecommitdiff
path: root/src/heretic/p_enemy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/heretic/p_enemy.c')
-rw-r--r--src/heretic/p_enemy.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/heretic/p_enemy.c b/src/heretic/p_enemy.c
index d569c78e..c2864668 100644
--- a/src/heretic/p_enemy.c
+++ b/src/heretic/p_enemy.c
@@ -2567,9 +2567,17 @@ void A_SkullPop(mobj_t * actor)
mo->player = player;
mo->health = actor->health;
mo->angle = actor->angle;
- player->mo = mo;
- player->lookdir = 0;
- player->damagecount = 32;
+
+ // fraggle: This check wasn't originally here in the Vanilla Heretic
+ // source, causing crashes if the player respawns before this
+ // function is called.
+
+ if (player != NULL)
+ {
+ player->mo = mo;
+ player->lookdir = 0;
+ player->damagecount = 32;
+ }
}
//----------------------------------------------------------------------------