diff options
author | Simon Howard | 2013-10-26 20:50:55 +0000 |
---|---|---|
committer | Simon Howard | 2013-10-26 20:50:55 +0000 |
commit | 2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9 (patch) | |
tree | 2de4b01dd8330e45fb245b0c972505ceb5affc01 /src/heretic | |
parent | 09c8d7e8d57c84f59500e0e6a8ee0686c20a3148 (diff) | |
download | chocolate-doom-2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9.tar.gz chocolate-doom-2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9.tar.bz2 chocolate-doom-2d6b1a9263855eb78d5dcd35feeab36bb4c1f0f9.zip |
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
Diffstat (limited to 'src/heretic')
-rw-r--r-- | src/heretic/p_enemy.c | 14 |
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; + } } //---------------------------------------------------------------------------- |