summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-06 22:30:07 +0200
committerGitHub <noreply@github.com>2021-04-06 22:30:07 +0200
commit0485a0d8b2585da6fc22d7d72ac6f2ae6c18778a (patch)
treed2e870fcfc6d1755617b5f22b4c0770ef84cce0a
parent17e0ad9d5b5881a32b559d2ec78075f1465965f2 (diff)
parent6544f8422f876bbe91048e6690571d9043ea6aec (diff)
Merge pull request #47668 from madmiraal/fix-47438
Ensure ConvexPolygonShape3D support count variable is initialised
-rw-r--r--servers/physics_3d/shape_3d_sw.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/servers/physics_3d/shape_3d_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp
index bf0946a0e2..4c14cb3162 100644
--- a/servers/physics_3d/shape_3d_sw.cpp
+++ b/servers/physics_3d/shape_3d_sw.cpp
@@ -891,6 +891,9 @@ void ConvexPolygonShape3DSW::get_supports(const Vector3 &p_normal, int p_max, Ve
const Vector3 *vertices = mesh.vertices.ptr();
int vc = mesh.vertices.size();
+ r_amount = 0;
+ ERR_FAIL_COND_MSG(vc == 0, "Convex polygon shape has no vertices.");
+
//find vertex first
real_t max = 0;
int vtx = 0;