Fix AI bot turn completion - remove isAIThinking block in endTurn()
This commit is contained in:
@@ -516,7 +516,7 @@ class GameUI {
|
||||
|
||||
async endTurn() {
|
||||
if (this.gamePhase !== 'movement') return;
|
||||
if (this.isAIThinking) return;
|
||||
// Remove isAIThinking check - AI needs to call endTurn() after its move
|
||||
|
||||
// Apply supply
|
||||
const supply = this.map.calculateSupply(this.currentPlayer);
|
||||
@@ -542,10 +542,9 @@ class GameUI {
|
||||
this.isAIThinking = true;
|
||||
this.updateUI();
|
||||
|
||||
// Run AI turn
|
||||
// Run AI turn and reset flag when done
|
||||
this.aiBots[this.currentPlayer].playTurn().then(() => {
|
||||
this.isAIThinking = false;
|
||||
// AI will call endTurn() when done
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user