소스 검색

Merge pull request #40655 from madmiraal/fix-40636

Ensure Bullet HeightMapShape3D data width and depth are at least 2.
Rémi Verschelde 5 년 전
부모
커밋
94ff5ee535
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      modules/bullet/shape_bullet.cpp

+ 3 - 0
modules/bullet/shape_bullet.cpp

@@ -504,6 +504,9 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) {
 	int l_width = d["width"];
 	int l_depth = d["depth"];
 
+	ERR_FAIL_COND_MSG(l_width < 2, "Map width must be at least 2.");
+	ERR_FAIL_COND_MSG(l_depth < 2, "Map depth must be at least 2.");
+
 	// TODO This code will need adjustments if real_t is set to `double`,
 	// because that precision is unnecessary for a heightmap and Bullet doesn't support it...