fix(@projects/@magic-civilization): 🐛 skip schema files in unit catalog

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-11 20:02:22 -07:00
parent 554480eb9c
commit c44befb577

View file

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