BUGFIX: Ensure that IPvGO promises are initialized correctly on a new save and on fluming (#2032)

This commit is contained in:
Michael Ficocelli
2025-03-17 18:55:32 -04:00
committed by GitHub
parent 88fef7d8a3
commit 47b34c8563
5 changed files with 15 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ import {
passTurn,
updateCaptures,
} from "../boardState/boardState";
import { getNextTurn, handleNextTurn, resetAI } from "../boardAnalysis/goAI";
import { getNextTurn, handleNextTurn, resetGoPromises } from "../boardAnalysis/goAI";
import {
evaluateIfMoveIsValid,
getControlledSpace,
@@ -22,7 +22,6 @@ import { endGoGame, getOpponentStats, getScore, resetWinstreak } from "../boardA
import { WHRNG } from "../../Casino/RNG";
import { getRecordKeys } from "../../Types/Record";
import { CalculateEffect, getEffectTypeForFaction } from "./effect";
import { exceptionAlert } from "../../utils/helpers/exceptionAlert";
import { newOpponentStats } from "../Constants";
/**
@@ -342,9 +341,8 @@ export function resetBoardState(
resetWinstreak(oldBoardState.ai, false);
}
resetAI();
Go.currentGame = getNewBoardState(boardSize, opponent, true);
handleNextTurn(Go.currentGame).catch((error) => exceptionAlert(error));
resetGoPromises();
logger(`New game started: ${opponent}, ${boardSize}x${boardSize}`);
return simpleBoardFromBoard(Go.currentGame.board);
}