From 4c9ccffad2dc033df371abe087d2703dc0094954 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sun, 10 May 2020 10:36:45 +0100 Subject: [PATCH] Prevent CapsuleShape2D height from being less than zero. (cherry picked from commit 68eaaa6d6b7757d0d1c4f6c6403c0c0c6b5d702b) --- scene/resources/capsule_shape_2d.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 008e8bb13d5..0b89abdea62 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -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(); }