summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-26 17:09:02 +0200
committerGitHub <noreply@github.com>2020-07-26 17:09:02 +0200
commit94ff5ee535ff3f20685b06e2b959e3a52b2eabbe (patch)
treec177c85b57239993a40fd99b3929b08b05f21dc2
parentb35be146daf5f9ddefd12d2863943c3e13d779a8 (diff)
parent236857c92a01473724f205eaba8fe8c0f89e3576 (diff)
Merge pull request #40655 from madmiraal/fix-40636
Ensure Bullet HeightMapShape3D data width and depth are at least 2.
-rw-r--r--modules/bullet/shape_bullet.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp
index f4550c2024..274493ed17 100644
--- a/modules/bullet/shape_bullet.cpp
+++ b/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...