settings: ignore invalid keys

This commit is contained in:
Crispy 2021-06-08 18:31:35 +02:00
parent f22efdea0a
commit dd28bdcb54

View file

@ -118,8 +118,10 @@ func _load_sub_setting(val, def):
var _s = {} var _s = {}
var resize = has_flag(def, "resize") var resize = has_flag(def, "resize")
for key in val: for key in val:
var subdef = def.definition if resize else def.definition[key] if resize:
_s[key] = _load_sub_setting(val[key], subdef) _s[key] = _load_sub_setting(val[key], def.definition)
elif def.definition.has(key):
_s[key] = _load_sub_setting(val[key], def.definition[key])
return _s return _s
_: _:
return val return val