Skip to content

Commit

Permalink
- recalculate the line deltas if a nodebuild is needed
Browse files Browse the repository at this point in the history
One potential cause is moving around vertices in which case these do not match anymore
  • Loading branch information
coelckers committed Jan 16, 2019
1 parent 91c934a commit 49abe36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/maploader/maploader.cpp
Expand Up @@ -3104,6 +3104,11 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position)
if (ForceNodeBuild)
{
BuildGLNodes = true;
// In case the compatibility handler made changes to the map's layout
for(auto &line : Level->lines)
{
line.AdjustLine();
}

startTime = I_msTime();
TArray<FNodeBuilder::FPolyStart> polyspots, anchors;
Expand Down Expand Up @@ -3152,7 +3157,7 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position)
// use in P_PointInSubsector to avoid problems with maps that depend on the specific
// nodes they were built with (P:AR E1M3 is a good example for a map where this is the case.)
reloop |= CheckNodes(map, BuildGLNodes, (uint32_t)(endTime - startTime));

// set the head node for gameplay purposes. If the separate gamenodes array is not empty, use that, otherwise use the render nodes.
Level->headgamenode = Level->gamenodes.Size() > 0 ? &Level->gamenodes[Level->gamenodes.Size() - 1] : Level->nodes.Size() ? &Level->nodes[Level->nodes.Size() - 1] : nullptr;

Expand Down

0 comments on commit 49abe36

Please sign in to comment.