From 29b1ca27c32e513c8461e99e985e4d3d8ea33111 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Mon, 11 Dec 2023 00:34:46 +1030 Subject: [PATCH] Replace hexadecimal parse hack --- scripts/managers/Common.gd | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/managers/Common.gd b/scripts/managers/Common.gd index 2e4195d..fab86fa 100644 --- a/scripts/managers/Common.gd +++ b/scripts/managers/Common.gd @@ -140,20 +140,15 @@ static func are_arrays_equal(a1: Array, a2: Array, fuzzy_types: bool = true) -> return true static func limited_eval(token: String): - # Try hexadecimal literal - if token.begins_with('0x'): - var hex := token.hex_to_int() - if hex > 0: - return hex - elif token.substr(2).is_valid_integer(): - # Special case for 0x000000... - return 0 # Try int literal if token.is_valid_integer(): return int(token) # Try float literal if token.is_valid_float(): return float(token) + # Try hexadecimal literal + if token.is_valid_hex_number(true): + return token.hex_to_int() # Try bool literal match token.to_lower(): 'true':