From e03a65fdea7a14bc319c6b957d958f1fb5d6aaa3 Mon Sep 17 00:00:00 2001 From: golfinq Date: Thu, 19 Oct 2023 23:41:55 -0400 Subject: [PATCH] replace confusing code in CapsuleShape2D --- servers/physics_2d/godot_shape_2d.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/servers/physics_2d/godot_shape_2d.cpp b/servers/physics_2d/godot_shape_2d.cpp index dadd8173c60..2b3f496fc02 100644 --- a/servers/physics_2d/godot_shape_2d.cpp +++ b/servers/physics_2d/godot_shape_2d.cpp @@ -373,8 +373,7 @@ void GodotCapsuleShape2D::get_supports(const Vector2 &p_normal, Vector2 *r_suppo if (h > 0 && Math::abs(n.x) > segment_is_valid_support_threshold) { // make it flat n.y = 0.0; - n.normalize(); - n *= radius; + n.x = SIGN(n.x) * radius; r_amount = 2; r_supports[0] = n;