From 28c7b3a17d9406469773bb2364c2f7d62748705a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Tue, 6 Apr 2021 16:46:04 +0100 Subject: [PATCH] Ensure ConvexPolygonShape support count variable is initialised --- servers/physics/shape_sw.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 025e7b15b22..1a24bf0e885 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -959,6 +959,9 @@ void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vect 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;