Skip to content

Commit 6c25431

Browse files
authored
Fix NaN check in RadioButton options, again (#899)
Comparing to NaN (even with itself) its always false, use Math.isNaN insted
1 parent 37eb193 commit 6c25431

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/funkin/options/OptionsMenu.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class OptionsMenu extends TreeMenu {
203203
continue;
204204
}
205205
var f = Std.parseFloat(node.att.value);
206-
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));
206+
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));
207207
case 'slider':
208208
if (!node.has.id) {
209209
Logs.warn("A slider option requires an \"id\" for option saving.");

0 commit comments

Comments
 (0)