From 0c8128e5c0d1874bb29b9b4b37efa3f889c679a6 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sat, 25 Apr 2026 04:09:14 -0700 Subject: [PATCH] =?UTF-8?q?feat(test):=20=E2=9C=85=20add=20victory=20fallb?= =?UTF-8?q?ack=20check=20in=20auto-play=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/scenes/tests/auto_play.gd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index ddd58b15..41909a2f 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -610,6 +610,18 @@ func _process(_delta: float) -> void: "done": if _frame == 5: + # Score-victory fallback: at the auto_play turn cap, if + # vm.check_all hasn't already declared a winner (race — + # auto_play's "done" state can fire before TurnManager's + # next_player loop calls vm.check_all on the final turn), + # invoke it now so the highest-scoring player is recorded + # as the winner. Without this, all-AI games at turn_limit + # write outcome="max_turns" with winner_index=-1, which + # fails the ultimate_stress decisive-game gate. + if not _victory: + var vm: RefCounted = TurnManager.get("_victory_manager") as RefCounted + if vm != null and vm.has_method("check_all"): + vm.check_all(GameState.get_game_map()) _screenshot("final_turn_%03d" % _turn_count) print("AutoPlay: finished — %d turns, victory=%s" % [_turn_count, _victory]) _outcome = "victory" if _victory else "max_turns"