From 571ea72f35a8531c1e9145bfa25b666b3c276c65 Mon Sep 17 00:00:00 2001 From: Silc 'Tokage' Renew Date: Wed, 10 Nov 2021 13:04:19 +0900 Subject: [PATCH] fix pingpong in math --- modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs index df0dcdb1bb..fbc8ff64a6 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs @@ -709,7 +709,7 @@ namespace Godot /// The ping-ponged value. public static real_t PingPong(real_t value, real_t length) { - return (length != 0.0) ? Math.Abs(Mathf.Fract((value - length) / (length * 2.0)) * length * 2.0 - length) : 0.0; + return (length != (real_t)0.0) ? Abs(Fract((value - length) / (length * (real_t)2.0)) * length * (real_t)2.0 - length) : (real_t)0.0; } } }