Quellcode durchsuchen

fix pingpong in math

Silc 'Tokage' Renew vor 3 Jahren
Ursprung
Commit
571ea72f35
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs

@@ -709,7 +709,7 @@ namespace Godot
         /// <returns>The ping-ponged value.</returns>
         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;
         }
     }
 }