From 00b157ecfc5ec21b13a03c14ea3fdfae837d9edb Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 10 May 2026 04:11:14 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20update=20renderer=20sync=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../scenes/tests/full_game_demo_proof.gd | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/game/engine/scenes/tests/full_game_demo_proof.gd b/src/game/engine/scenes/tests/full_game_demo_proof.gd index 77aebdd6..c78bada6 100644 --- a/src/game/engine/scenes/tests/full_game_demo_proof.gd +++ b/src/game/engine/scenes/tests/full_game_demo_proof.gd @@ -94,23 +94,25 @@ func _ready() -> void: var empty_fog: Array[Vector2i] = [] hex.update_fog(all_positions, empty_fog) + # Aggregate every player's units / cities and feed them into the + # renderers via their canonical sync_* surfaces. + var all_units: Array = [] + var all_cities: Array = [] + for p: Variant in GameState.players: + if p is PlayerScript: + all_units.append_array((p as PlayerScript).units) + all_cities.append_array((p as PlayerScript).cities) + var units: Node2D = UnitRendererScript.new() units.name = "UnitRenderer" add_child(units) - if units.has_method("setup_visibility"): - units.call("setup_visibility", 0, game_map) - if units.has_method("render_units"): - units.call("render_units", game_map) - elif units.has_method("refresh"): - units.call("refresh") + units.call("setup_visibility", 0, game_map) + units.call("sync_units", all_units) var cities: Node2D = CityRendererScript.new() cities.name = "CityRenderer" add_child(cities) - if cities.has_method("refresh"): - cities.call("refresh") - elif cities.has_method("render_cities"): - cities.call("render_cities") + cities.call("sync_cities", all_cities) # Camera centred on the actual pixel-bbox of the rendered tiles. The # axial→pixel transform isn't a simple linear scale (flat-top hex offset