From 19ef8399a8b70cc3e9ea45800fdc37455650d8f5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Oct 2009 20:18:31 +0000 Subject: [PATCH] - added a NULL pointer check to fog spawning in unmorphing code. - fixed: frozen corpses need to be treated as solid by z-movement code. - fixed previous commit. SVN r1903 (trunk) --- docs/rh-log.txt | 2 ++ src/g_shared/a_morph.cpp | 5 ++++- src/p_map.cpp | 23 +++++++++++++++++++---- src/s_advsound.cpp | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 1e6b1e8838..c819c38973 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ October 9, 2009 (Changes by Graf Zahl) +- added a NULL pointer check to fog spawning in unmorphing code. +- fixed: frozen corpses need to be treated as solid by z-movement code. - fixed: AAmbientSound::Serialize was adjusting its timer value for savegames even when it was set to a 'don't check' value. diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index f12c36aef0..917ae5a928 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -314,7 +314,10 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag, } angle = mo->angle >> ANGLETOFINESHIFT; - Spawn(exit_flash, pmo->x + 20*finecosine[angle], pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE); + if (exit_flash != NULL) + { + Spawn(exit_flash, pmo->x + 20*finecosine[angle], pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE); + } mo->SetupWeaponSlots(); // Use original class's weapon slots. beastweap = player->ReadyWeapon; if (player->PremorphWeapon != NULL) diff --git a/src/p_map.cpp b/src/p_map.cpp index 8bd38498c3..fe7f5f790c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1441,10 +1441,15 @@ bool P_TestMobjZ (AActor *actor, bool quick, AActor **pOnmobj) { // Can't hit thing continue; } - if (thing->flags & (MF_SPECIAL|MF_NOCLIP|MF_CORPSE)) - { // [RH] Corpses and specials and noclippers don't block moves + if (thing->flags & (MF_SPECIAL|MF_NOCLIP)) + { // [RH] Specials and noclippers don't block moves continue; } + if (thing->flags & (MF_CORPSE)) + { // Corpses need a few more checks + if (!(actor->flags & MF_ICECORPSE)) + continue; + } if (!(thing->flags4 & MF4_ACTLIKEBRIDGE) && (actor->flags & MF_SPECIAL)) { // [RH] Only bridges block pickup items continue; @@ -4315,10 +4320,15 @@ void P_FindAboveIntersectors (AActor *actor) { // Can't hit thing continue; } - if (thing->flags & (MF_CORPSE|MF_SPECIAL)) + if (thing->flags & (MF_SPECIAL)) { // [RH] Corpses and specials don't block moves continue; } + if (thing->flags & (MF_CORPSE)) + { // Corpses need a few more checks + if (!(actor->flags & MF_ICECORPSE)) + continue; + } if (thing == actor) { // Don't clip against self continue; @@ -4364,10 +4374,15 @@ void P_FindBelowIntersectors (AActor *actor) { // Can't hit thing continue; } - if (thing->flags & (MF_CORPSE|MF_SPECIAL)) + if (thing->flags & (MF_SPECIAL)) { // [RH] Corpses and specials don't block moves continue; } + if (thing->flags & (MF_CORPSE)) + { // Corpses need a few more checks + if (!(actor->flags & MF_ICECORPSE)) + continue; + } if (thing == actor) { // Don't clip against self continue; diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 11c541f45c..14742f55d3 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -1940,7 +1940,7 @@ void AAmbientSound::Serialize (FArchive &arc) else { arc << NextCheck; - if (checktime != INT_MAX) + if (NextCheck != INT_MAX) { NextCheck += gametic; }