Clean up behaviors properly when moving levels

Also adds support for foreach loops with the behavior iterator.
This commit is contained in:
Boondorl 2025-01-25 10:52:54 -05:00 committed by Ricardo Luís Vaz Silva
commit 1e05bb2a55
6 changed files with 55 additions and 2 deletions

View file

@ -380,6 +380,7 @@ void FLevelLocals::ClearLevelData(bool fullgc)
aabbTree = nullptr;
levelMesh = nullptr;
VisualThinkerHead = nullptr;
ActorBehaviors.Clear();
if (screen)
screen->SetAABBTree(nullptr);
}