Check for empty ConcavePolygonShape2D before checking for intersection

This commit is contained in:
Marcel Admiraal 2021-04-06 19:43:51 +01:00
parent e97cd3d52d
commit 83da95b6e4

View file

@ -743,6 +743,9 @@ bool ConcavePolygonShape2DSW::contains_point(const Vector2 &p_point) const {
bool ConcavePolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Vector2 &p_end, Vector2 &r_point, Vector2 &r_normal) const {
if (segments.size() == 0 || points.size() == 0)
return false;
uint32_t *stack = (uint32_t *)alloca(sizeof(int) * bvh_depth);
enum {