From 88d5bf68770b5bfc113386b349bf63b5c5159460 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 19:03:25 +0200 Subject: [PATCH] - relax pointer substitution restriction for morphed monsters. --- src/playsim/p_mobj.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 6945bc9a55..de0ff1b6b9 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -4943,9 +4943,12 @@ void StaticPointerSubstitution(AActor* old, AActor* notOld) if (old == nullptr) return; - // This is only allowed to replace players. For everything else the results are undefined. - if (!old->IsKindOf(NAME_PlayerPawn) || (notOld != nullptr && !notOld->IsKindOf(NAME_PlayerPawn))) return; - + // This is only allowed to replace players or swap out morphed monsters + if (!old->IsKindOf(NAME_PlayerPawn) || (notOld != nullptr && !notOld->IsKindOf(NAME_PlayerPawn))) + { + if (notOld == nullptr) return; + if (!old->IsKindOf(NAME_MorphedMonster) && !notOld->IsKindOf(NAME_MorphedMonster)) return; + } // Go through all objects. i = 0; DObject* last = 0; for (probe = GC::Root; probe != NULL; probe = probe->ObjNext)