diff --git a/source/core/rendering/hw_sections2.cpp b/source/core/rendering/hw_sections2.cpp index 4350171dc..86b43d31e 100644 --- a/source/core/rendering/hw_sections2.cpp +++ b/source/core/rendering/hw_sections2.cpp @@ -595,11 +595,14 @@ static void ConstructSections(TArray& builders) auto wal = wallmap[srcloop[w]]; section->walls[curwall++] = loop.walls[w] = wal; wal->section = section->index; - // backsection will be filled in when everything is done. + wal->index = section2walls.Size(); + section2walls.Push(wal); } } } } + section2walls.ShrinkToFit(); + sections2.ShrinkToFit(); } //========================================================================== @@ -613,6 +616,7 @@ void hw_CreateSections2() bugged.Clear(); sectionArena.FreeAll(); sections2.Reset(); + section2walls.Clear(); TArray collect; CollectLoops(collect);