diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-07-24 12:08:01 +0100 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2020-07-24 13:40:26 +0100 |
commit | 236857c92a01473724f205eaba8fe8c0f89e3576 (patch) | |
tree | a488b743bcffd8aed4442f900f75a55a6d9dbe2f /modules | |
parent | 93b50a62e333cd05702fb749ebcdc18127abe01b (diff) |
Ensure Bullet HeightMapShape3D data width and depth are at least 2.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/shape_bullet.cpp | 3 |
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... |