fix(@projects/@magic-civilization): 🐛 skip schema files in unit catalog
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
554480eb9c
commit
c44befb577
1 changed files with 10 additions and 1 deletions
|
|
@ -192,7 +192,16 @@ func _apply_runtime_units_catalog(gs: RefCounted) -> void:
|
|||
dir.list_dir_begin()
|
||||
var fname: String = dir.get_next()
|
||||
while fname != "":
|
||||
if not dir.current_is_dir() and fname.ends_with(".json"):
|
||||
# Skip `*.schema.json` — those are JSON Schema descriptors that
|
||||
# live alongside the unit data files but describe the shape, not
|
||||
# instances of it. Including them would feed the deserializer
|
||||
# `{"$schema": "...", "type": "object", "properties": {...}}`
|
||||
# without an `id` field, which correctly rejects.
|
||||
if (
|
||||
not dir.current_is_dir()
|
||||
and fname.ends_with(".json")
|
||||
and not fname.ends_with(".schema.json")
|
||||
):
|
||||
var path: String = UNITS_DIR + "/" + fname
|
||||
var f: FileAccess = FileAccess.open(path, FileAccess.READ)
|
||||
if f != null:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue