diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2019-04-04 21:22:18 +0100 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2019-04-04 21:22:18 +0100 |
commit | cdcdba704b989aa9d7decc40d3181f8378378512 (patch) | |
tree | 5413c8269ee9393b7150b59adf5da186b4bb3f93 /modules | |
parent | 6d2722613476f36c584b69b5b4e9dd88e4be1cec (diff) |
Fix wrong heights data used to compute min and max heights
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/shape_bullet.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp index 1aba31f03d..b590d63167 100644 --- a/modules/bullet/shape_bullet.cpp +++ b/modules/bullet/shape_bullet.cpp @@ -510,16 +510,17 @@ void HeightMapShapeBullet::set_data(const Variant &p_data) { // Compute min and max heights if not specified. if (!d.has("min_height") && !d.has("max_height")) { - PoolVector<real_t>::Read r = heights.read(); - int heights_size = heights.size(); + PoolVector<real_t>::Read r = l_heights.read(); + int heights_size = l_heights.size(); for (int i = 0; i < heights_size; ++i) { real_t h = r[i]; - if (h < l_min_height) + if (h < l_min_height) { l_min_height = h; - else if (h > l_max_height) + } else if (h > l_max_height) { l_max_height = h; + } } } |