Prevent CapsuleShape2D height from being less than zero.

(cherry picked from commit 68eaaa6d6b)
This commit is contained in:
Marcel Admiraal 2020-05-10 10:36:45 +01:00 committed by Rémi Verschelde
parent 752f61d4fe
commit 4c9ccffad2
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ real_t CapsuleShape2D::get_radius() const {
void CapsuleShape2D::set_height(real_t p_height) {
height = p_height;
if (height < 0)
height = 0;
_update_shape();
}