Preserve packed definition arrays in exports

This commit is contained in:
Loïc Wisniewski 2026-08-31 15:23:25 +02:00
commit 546107efb9
6 changed files with 29 additions and 5 deletions

View file

@ -46,6 +46,7 @@ static func faults() -> PackedStringArray:
var found: PackedStringArray = PackedStringArray()
_check_vessels(found)
_check_buildings(found)
_check_planets(found)
return found
@ -107,6 +108,12 @@ static func _check_buildings(found: PackedStringArray) -> void:
# rather than a thing standing in the world, and has no scene.
if definition.placement_mode == "space" and definition.visual_scene == null:
found.append("building %s stands in space with nothing to draw" % id)
if definition.visual_scene != null:
var visual: Node = definition.visual_scene.instantiate()
var provider: Node = visual.get_node_or_null("ActionProvider")
if provider != null and Array(provider.actions).is_empty():
found.append("building %s has an action provider with no actions" % id)
visual.free()
for field in ["menu_button_name", "menu_label_name", "menu_cost_name"]:
if str(definition.get(field)).strip_edges() == "":
found.append("building %s has no %s - the build menu could not place it" % [id, field])
@ -127,3 +134,10 @@ static func _check_buildings(found: PackedStringArray) -> void:
found.append("building %s converts but lists no collected outputs - what it makes would never be fetched" % id)
if _list(logistics, "input_buffers").is_empty():
found.append("building %s converts with no input buffer" % id)
static func _check_planets(found: PackedStringArray) -> void:
for definition in PlanetDefinitions.DEFINITIONS.values():
var id: String = String(definition.definition_id)
if definition.names.is_empty():
found.append("planet %s has no generated names" % id)