From d16bef8b55e6c978da44ea3c4b0822340e15027c Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Fri, 21 May 2021 17:12:13 +0800 Subject: Fix STL to Godot type convertion of polypartition --- thirdparty/misc/polypartition.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'thirdparty/misc/polypartition.cpp') diff --git a/thirdparty/misc/polypartition.cpp b/thirdparty/misc/polypartition.cpp index 4f1b6dcb21..5e94793b79 100644 --- a/thirdparty/misc/polypartition.cpp +++ b/thirdparty/misc/polypartition.cpp @@ -1289,7 +1289,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto bool error = false; numvertices = 0; - for (iter = inpolys->front(); iter; iter++) { + for (iter = inpolys->front(); iter; iter = iter->next()) { numvertices += iter->get().GetNumPoints(); } @@ -1298,7 +1298,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newnumvertices = numvertices; polystartindex = 0; - for (iter = inpolys->front(); iter; iter++) { + for (iter = inpolys->front(); iter; iter = iter->next()) { poly = &(iter->get()); polyendindex = polystartindex + poly->GetNumPoints() - 1; for (i = 0; i < poly->GetNumPoints(); i++) { @@ -1408,7 +1408,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -1449,7 +1449,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } @@ -1494,7 +1494,7 @@ int TPPLPartition::MonotonePartition(TPPLPolyList *inpolys, TPPLPolyList *monoto newedge.p1 = v->p; newedge.p2 = v->p; edgeIter = edgeTree.lower_bound(newedge); - if (edgeIter == edgeTree.front()) { + if (edgeIter == nullptr || edgeIter == edgeTree.front()) { error = true; break; } -- cgit v1.2.3