Преглед изворни кода

Change behavior of Math::sign to match Godot builtin

Fixes #551.
Erik Abair пре 4 година
родитељ
комит
d3f17c1dca
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      include/godot_cpp/core/math.hpp

+ 1 - 1
include/godot_cpp/core/math.hpp

@@ -433,7 +433,7 @@ inline T max(T a, T b) {
 
 template <typename T>
 inline T sign(T x) {
-	return static_cast<T>(x < 0 ? -1 : 1);
+	return static_cast<T>(SIGN(x));
 }
 
 template <typename T>