- relax pointer substitution restriction for morphed monsters.

This commit is contained in:
Christoph Oelckers 2020-04-19 19:03:25 +02:00
parent 052172b9ee
commit bd3f4e7347

View file

@ -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)