From 9e8c928d04b9413c22147e51e45a86b48a1361d6 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sat, 18 Apr 2026 21:35:31 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20handle=20missing=20player=20slots=20in=20auto-pl?= =?UTF-8?q?ay=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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index 5eb42c71..65fe92e3 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -802,7 +802,9 @@ func _apply_per_player_difficulty_overrides() -> void: var levels: Dictionary = {} for entry: Dictionary in diff_data.get("ai_difficulty", []): levels[str(entry.get("id", ""))] = entry.get("ai_modifiers", {}) - for p_idx: int in range(GameState.players.size()): + # Use a fixed upper bound — this runs before loading_screen.gd populates + # GameState.players, so players.size() == 0. Check all possible player slots. + for p_idx: int in range(8): var key: String = "AI_DIFFICULTY_P%d" % p_idx var tier: String = EnvConfig.get_var(key, "") if tier.is_empty():