summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-03-08 01:19:22 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-03-08 01:19:22 +0000
commite7e30f489171a8f3a019f8ca35d691938e546e7b (patch)
tree00fff4588b32ab777ac987f25bf60d07c557efc8
parentRework stream support to work with any collection (diff)
downloadilt-e7e30f489171a8f3a019f8ca35d691938e546e7b.tar.bz2
ilt-e7e30f489171a8f3a019f8ca35d691938e546e7b.tar.xz
ilt-e7e30f489171a8f3a019f8ca35d691938e546e7b.zip
Bail out early if the input does not define an area
-rw-r--r--game/geoData.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index 8c635a0..9a08a89 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -381,6 +381,10 @@ GeoData::triangleContainsTriangle(const Triangle<2> & a, const Triangle<2> & b)
void
GeoData::setHeights(const std::span<const GlobalPosition3D> triangleStrip)
{
+ if (triangleStrip.size() < 3) {
+ return;
+ }
+
// Create new vertices
std::vector<VertexHandle> newVerts;
newVerts.reserve(newVerts.size());