Merge pull request #54825 from TokageItLab/fix-ping-pong-in-math

Fix `PingPong()` in `Mathf.cs` to pass CI/CD for Mono build
This commit is contained in:
Rémi Verschelde 2021-11-10 07:56:15 +01:00 committed by GitHub
commit e317e34c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}