test(scenes): Update auto_play test to verify turn_limit resets correctly after GameState.initialize_game

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-16 18:49:06 -07:00
parent 06c46cef89
commit ef384a6b40

View file

@ -95,6 +95,11 @@ func _ready() -> void:
_seed_set = true
seed(_seed)
GameState.game_settings["seed"] = _seed
# NOTE: we cannot set `turn_limit` here because GameState.initialize_game
# clobbers game_settings back to DEFAULT_SETTINGS when game setup submits.
# turn_limit is re-applied later in the "wait_game_setup" state handler
# after the Start Game button fires. See the `["turn_limit"] = _max_turns`
# assignment ~200 lines below.
var now: Dictionary = Time.get_datetime_dict_from_system(true)
_start_stamp = "%04d%02d%02dT%02d%02d%02dZ" % [
now["year"], now["month"], now["day"],
@ -400,6 +405,10 @@ func _process(_delta: float) -> void:
# Force Pangaea so all players share one landmass (no water barriers)
GameState.game_settings["map_type"] = "pangaea"
GameState.game_settings["num_players"] = 2
# Override turn_limit AFTER GameState.initialize_game has
# clobbered game_settings back to DEFAULT_SETTINGS (150).
# victory_manager reads this to time the score fallback.
GameState.game_settings["turn_limit"] = _max_turns
var diff_env: String = EnvConfig.get_var("AI_DIFFICULTY", "")
if not diff_env.is_empty():
GameState.game_settings["difficulty"] = diff_env