Fix AI bot turn completion - remove isAIThinking block in endTurn()
This commit is contained in:
@@ -516,8 +516,8 @@ 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);
|
||||
this.distributeSupply(supply);
|
||||
@@ -541,11 +541,10 @@ class GameUI {
|
||||
if (this.playerTypes[this.currentPlayer] === 'ai' && this.aiBots[this.currentPlayer]) {
|
||||
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