fix(@projects/@magic-civilization): 🐛 fix visibility short-circuit in render test
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
2f4c8a7756
commit
4b15fd8f97
1 changed files with 10 additions and 2 deletions
|
|
@ -246,7 +246,12 @@ func _build_renderers() -> void:
|
|||
_unit_renderer = UnitRendererScript.new()
|
||||
_unit_renderer.name = "UnitRenderer"
|
||||
add_child(_unit_renderer)
|
||||
_unit_renderer.call("setup_visibility", _claude_slot, _game_map)
|
||||
# Pass `local_player=-1` so `_is_unit_visible` short-circuits to true
|
||||
# for ALL units. We're in omniscient mode driving the renderer
|
||||
# from the unredacted projection; the per-tile visibility gate would
|
||||
# otherwise hide every enemy unit since we never propagate per-player
|
||||
# tile visibility into `_game_map.tiles[*].visibility`.
|
||||
_unit_renderer.call("setup_visibility", -1, _game_map)
|
||||
|
||||
_city_renderer = CityRendererScript.new()
|
||||
_city_renderer.name = "CityRenderer"
|
||||
|
|
@ -271,8 +276,11 @@ func _build_renderers() -> void:
|
|||
_camera.name = "DemoCamera"
|
||||
_camera.position = center
|
||||
_camera.zoom = Vector2(zoom_factor, zoom_factor)
|
||||
_camera.make_current()
|
||||
add_child(_camera)
|
||||
# `make_current` is a no-op until the node is inside the tree, so it
|
||||
# MUST come after `add_child`. The reverse order spams a Camera2D
|
||||
# warning at boot and silently drops the activation.
|
||||
_camera.make_current()
|
||||
|
||||
|
||||
# ── Main loop ─────────────────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue