소스 검색

Fix errors and crash with empty ConvexPolygonShape2D

(cherry picked from commit 6fb609074895b8681cc42af866782e4963567a23)
PouleyKetchoupp 4 년 전
부모
커밋
6c0002afb5
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      scene/resources/convex_polygon_shape_2d.cpp

+ 3 - 0
scene/resources/convex_polygon_shape_2d.cpp

@@ -78,6 +78,9 @@ void ConvexPolygonShape2D::_bind_methods() {
 }
 
 void ConvexPolygonShape2D::draw(const RID &p_to_rid, const Color &p_color) {
+	if (points.size() < 3) {
+		return;
+	}
 
 	Vector<Color> col;
 	col.push_back(p_color);