From 6544f8422f876bbe91048e6690571d9043ea6aec Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Tue, 6 Apr 2021 16:45:05 +0100 Subject: [PATCH] Ensure ConvexPolygonShape3D support count variable is initialised --- servers/physics_3d/shape_3d_sw.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/servers/physics_3d/shape_3d_sw.cpp b/servers/physics_3d/shape_3d_sw.cpp index bf0946a0e254..4c14cb3162d2 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;