commit 2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9
Author: Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Oct 26 20:50:55 2013 +0000
Commit: Simon Howard <fraggle@gmail.com>
CommitDate: Sat Oct 26 20:50:55 2013 +0000
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(-)
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;
+ }
}
//----------------------------------------------------------------------------