feat(test): ✅ add victory fallback check in auto-play test
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
ad7845d793
commit
0c8128e5c0
1 changed files with 12 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue