feat(game-scenes): Add deterministic seed injection to auto-play.gd for consistent automated test execution

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-15 00:29:24 -07:00
parent a760ff8654
commit 0d59edd637

View file

@ -277,6 +277,16 @@ func _process(_delta: float) -> void:
var btn: Button = _find_button("Start Game")
if btn != null:
_screenshot("02_game_setup")
# Inject AUTO_PLAY_SEED into the setup UI before submitting,
# otherwise game_setup.gd._compose_seed() overrides us with the
# default 42 via GameState.initialize_game() clobbering game_settings.
if _seed_set:
var setup_node: Node = _find_node_by_name(
get_tree().root, "GameSetup"
)
if setup_node != null and setup_node.has_method("_set_seed"):
setup_node._set_seed(_seed)
print("AutoPlay: injected seed=%d into game_setup UI" % _seed)
print("AutoPlay: [setup] Start Game (2 players)")
btn.pressed.emit()
# Force Pangaea so all players share one landmass (no water barriers)