Update invalid key type error

This commit is contained in:
JeremyStar™ 2024-03-31 14:13:23 +02:00
parent 897b207cac
commit a58bfb23dc

View file

@ -27,7 +27,7 @@ func _ready() -> void:
config.set_script(load(config_path))
for config_key in config_keys:
if config.get(config_key) != null:
if typeof(config.get(config_key)) != config_keys[config_key]: await lcrash("Configuration error: Key \"" + config_key + "\" is not of type '" + type_string(config_keys[config_key]) + "'")
if typeof(config.get(config_key)) != config_keys[config_key]: await lerror("Configuration error: Key \"" + config_key + "\" is not of type '" + type_string(config_keys[config_key]) + "' (is '" + type_string(typeof(config.get(config_key))) + "')")
ldiag("Configuration update: Key \"" + config_key + "\" has been updated")
set("config_" + config_key, config.get(config_key))