From 49abe3678a0620f97639bc39e7434f6b900c94bc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 16 Jan 2019 05:27:48 +0100 Subject: [PATCH] - recalculate the line deltas if a nodebuild is needed One potential cause is moving around vertices in which case these do not match anymore --- src/maploader/maploader.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 4028ac5223c..9ff50d47667 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -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 polyspots, anchors; @@ -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;