- fixed crash when loading a saved game with unknown class

During serialization, when map shutdown because of unknown class stored inside saved game may occur, level member is not assigned yet to already spawned thinkers
This commit is contained in:
alexey.lysiuk 2019-05-30 10:26:06 +03:00
parent d9c619c800
commit ffd464c26c

View file

@ -4819,7 +4819,10 @@ void AActor::OnDestroy ()
// note that this differs from ThingSpawned in that you can actually override OnDestroy to avoid calling the hook.
// but you can't really do that without utterly breaking the game, so it's ok.
// note: if OnDestroy is ever made optional, E_WorldThingDestroyed should still be called for ANY thing.
if (Level != nullptr)
{
Level->localEventManager->WorldThingDestroyed(this);
}
DeleteAttachedLights();
ClearRenderSectorList();