From b5591bf5f67b761bac5d059f9bc3547a4b84c6ec Mon Sep 17 00:00:00 2001 From: PixelDough Date: Mon, 17 Nov 2025 18:21:48 -0600 Subject: [PATCH] change AsSpan to use a range from "from" to "end" the current code assumes that float.Parse behaves the same as the internal C++ code, however without using "end" as part of the span, it will parse from index 0 to the end of the string, ignoring commas. for example, this causes it to parse "0,5,0" with divisor "," as [50, 50, 0], as the float.Parse method ignores commas in floats. if another divisor is used, it throws a System.FormatException due to containing invalid characters, as it fails to account for the position of the divisor for the span. --- .../mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs index 67e52a37b0b..b12c82b349d 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs @@ -1539,7 +1539,7 @@ namespace Godot if (end < 0) end = len; if (allowEmpty || end > from) - ret.Add(float.Parse(instance.AsSpan(from), CultureInfo.InvariantCulture)); + ret.Add(float.Parse(instance.AsSpan(from, end - from), CultureInfo.InvariantCulture)); if (end == len) break;