diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-03-01 13:36:21 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-03-01 13:36:21 -0300 |
commit | a73ca79402af0205a3b1ad78b8e7b9c7fb9225a3 (patch) | |
tree | f8b5cf05396f8d95e4bb9e7afbdfbf37400f980a | |
parent | 8799f69b2c461d7c018aa6cd52f848879df47546 (diff) |
Fix CSG crash, closes #26281
-rw-r--r-- | modules/csg/csg.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index fb7f829cf0..0eb539b182 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -953,13 +953,15 @@ void CSGBrushOperation::_merge_poly(MeshMerge &mesh, int p_face_idx, const Build //duplicate point int insert_at = with_outline_vertex; - polys.write[i].points.insert(insert_at, polys[i].points[insert_at]); + int point = polys[i].points[insert_at]; + polys.write[i].points.insert(insert_at, point); insert_at++; //insert all others, outline should be backwards (must check) int holesize = polys[i].holes[j].size(); for (int k = 0; k <= holesize; k++) { int idx = (from_hole_vertex + k) % holesize; - polys.write[i].points.insert(insert_at, polys[i].holes[j][idx]); + int point2 = polys[i].holes[j][idx]; + polys.write[i].points.insert(insert_at, point2); insert_at++; } |