Merge pull request #47668 from madmiraal/fix-47438

Ensure ConvexPolygonShape3D support count variable is initialised
This commit is contained in:
Rémi Verschelde 2021-04-06 22:30:07 +02:00 committed by GitHub
commit 0485a0d8b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;