From 19f8b0373825fce979f302912ebd6a2136e130b3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 12 Jul 2009 12:19:11 +0000 Subject: [PATCH] - Backported 2 fixes from Skulltag: * A_SentinelAttack must check for a NULL target * Monsters with CANTLEAVEFLOORPIC could not move because their floor texture was not initialized. SVN r1715 (trunk) --- docs/rh-log.txt | 4 ++++ src/g_strife/a_sentinel.cpp | 6 ++++++ src/p_map.cpp | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f1f40f4a71..d2567c9dc8 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ July 12, 2009 (Changes by Graf Zahl) +- Backported 2 fixes from Skulltag: + * A_SentinelAttack must check for a NULL target + * Monsters with CANTLEAVEFLOORPIC could not move because their floor + texture was not initialized. - Fixed: The 'idclev' cheat set the player's health to 0 which caused the level to end when in a sector of type 'end level when health below 10'. diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index 65c7483d32..5f012cfb18 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -42,6 +42,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack) { AActor *missile, *trail; + // [BB] Without a target the P_SpawnMissileZAimed call will crash. + if (!self->target) + { + return; + } + missile = P_SpawnMissileZAimed (self, self->z + 32*FRACUNIT, self->target, PClass::FindClass("SentinelFX2")); if (missile != NULL && (missile->velx | missile->vely) != 0) diff --git a/src/p_map.cpp b/src/p_map.cpp index 6e25187487..5a4e75518e 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -269,6 +269,12 @@ void P_FindFloorCeiling (AActor *actor, bool onlyspawnpos) else { actor->floorsector = actor->ceilingsector = actor->Sector; + // [BB] Don't forget to update floorpic and ceilingpic. + if (actor->Sector != NULL) + { + actor->floorpic = actor->Sector->GetTexture(sector_t::floor); + actor->ceilingpic = actor->Sector->GetTexture(sector_t::ceiling); + } } }