Fix NaN check in RadioButton options, again (#899)

Comparing to NaN (even with itself) its always false, use Math.isNaN insted
This commit is contained in:
axel
2026-02-03 21:19:12 +07:00
committed by GitHub
parent 37eb193e53
commit 6c25431c75
+1 -1
View File
@@ -203,7 +203,7 @@ class OptionsMenu extends TreeMenu {
continue;
}
var f = Std.parseFloat(node.att.value);
options.push(new RadioButton(screen, name, desc, node.att.id, f == Math.NaN ? node.att.value : f, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
options.push(new RadioButton(screen, name, desc, node.att.id, Math.isNaN(f) ? node.att.value : f, null, FlxG.save.data, node.has.forId ? node.att.forId : null));
case 'slider':
if (!node.has.id) {
Logs.warn("A slider option requires an \"id\" for option saving.");