From 2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 26 Oct 2013 20:50:55 +0000 Subject: Don't crash Heretic in A_SkullPop() if a player is gibbed and respawns before the head separates from the body (thanks Tumlee). Subversion-branch: /branches/v2-branch Subversion-revision: 2720 --- src/heretic/p_enemy.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/heretic') 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; + } } //---------------------------------------------------------------------------- -- cgit v1.2.3