From d3f17c1dcaff98ab2876438c7c1b731b45e1d9b2 Mon Sep 17 00:00:00 2001 From: Erik Abair Date: Thu, 6 May 2021 08:46:53 -0700 Subject: [PATCH] Change behavior of Math::sign to match Godot builtin Fixes #551. --- include/godot_cpp/core/math.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/godot_cpp/core/math.hpp b/include/godot_cpp/core/math.hpp index 361395d1..2ead2c30 100644 --- a/include/godot_cpp/core/math.hpp +++ b/include/godot_cpp/core/math.hpp @@ -433,7 +433,7 @@ inline T max(T a, T b) { template inline T sign(T x) { - return static_cast(x < 0 ? -1 : 1); + return static_cast(SIGN(x)); } template