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':