Fix AI bot turn completion - remove isAIThinking block in endTurn()

This commit is contained in:
sokol
2026-02-21 20:48:29 +03:00
parent 064f3ae263
commit 64c81da166

View File

@@ -516,7 +516,7 @@ class GameUI {
async endTurn() { async endTurn() {
if (this.gamePhase !== 'movement') return; if (this.gamePhase !== 'movement') return;
if (this.isAIThinking) return; // Remove isAIThinking check - AI needs to call endTurn() after its move
// Apply supply // Apply supply
const supply = this.map.calculateSupply(this.currentPlayer); const supply = this.map.calculateSupply(this.currentPlayer);
@@ -542,10 +542,9 @@ class GameUI {
this.isAIThinking = true; this.isAIThinking = true;
this.updateUI(); this.updateUI();
// Run AI turn // Run AI turn and reset flag when done
this.aiBots[this.currentPlayer].playTurn().then(() => { this.aiBots[this.currentPlayer].playTurn().then(() => {
this.isAIThinking = false; this.isAIThinking = false;
// AI will call endTurn() when done
}); });
} }
} }