- fixed a few dangling pointers on traveling between levels

https://forum.zdoom.org/viewtopic.php?t=69747
This commit is contained in:
alexey.lysiuk 2020-09-02 15:33:30 +03:00
commit c46dcd03a3
2 changed files with 9 additions and 1 deletions

View file

@ -279,6 +279,15 @@ void FLevelLocals::ClearPortals()
void FLevelLocals::ClearLevelData()
{
{
auto it = GetThinkerIterator<AActor>(NAME_None, STAT_TRAVELLING);
for (AActor *actor = it.Next(); actor != nullptr; actor = it.Next())
{
actor->BlockingLine = nullptr;
actor->BlockingFloor = actor->BlockingCeiling = actor->Blocking3DFloor = nullptr;
}
}
interpolator.ClearInterpolations(); // [RH] Nothing to interpolate on a fresh level.
Thinkers.DestroyAllThinkers();
ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process.