From b410b2e37b91d9bb39eeb98af45d603b74281be2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 23 Dec 2024 13:55:29 +0000 Subject: Set surface from all triangles, not just the first First may already have a surface in the case of a join --- game/geoData.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game/geoData.cpp b/game/geoData.cpp index d01b4d5..fb3cb15 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -600,7 +600,9 @@ GeoData::setHeights(const std::span triangleStrip, const }); } }; - surfaceStripWalk(surfaceStripWalk, findPoint(strip.front().centroid())); + for (const auto & triangle : strip) { + surfaceStripWalk(surfaceStripWalk, findPoint(triangle.centroid())); + } updateAllVertexNormals(newOrChangedVerts); generation++; -- cgit v1.2.3