summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/mesh.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index ec33bb53d9..c454301e02 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -775,8 +775,10 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const {
DVector<int> indices = a[ARRAY_INDEX];
DVector<int>::Read ir = indices.read();
- for(int i=0;i<ic;i++)
- facesw[widx++]=vr[ ir[i] ];
+ for(int i=0;i<ic;i++) {
+ int index = ir[i];
+ facesw[widx++]=vr[ index ];
+ }
} else {