From 11106a08b50e8027ebbb5ccd14fb0b3c7972457b 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. # Conflicts: # src/p_mobj.cpp --- src/dobject.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dobject.cpp b/src/dobject.cpp index f93f0934f..d49f291cb 100644 --- a/src/dobject.cpp +++ b/src/dobject.cpp @@ -495,8 +495,12 @@ void DObject::StaticPointerSubstitution (AActor *old, AActor *notOld) size_t changed = 0; int i; - // 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;