IPVGO: Prevent issues caused by resetting the board while the go AI is in flight (#1608)

This commit is contained in:
Michael Ficocelli
2024-09-07 21:33:49 -04:00
committed by GitHub
parent 4f426e1b20
commit 2a5b0ca4e9
6 changed files with 32 additions and 10 deletions
+2 -1
View File
@@ -18,7 +18,7 @@ import { GoScoreModal } from "./GoScoreModal";
import { GoGameboard } from "./GoGameboard";
import { GoSubnetSearch } from "./GoSubnetSearch";
import { CorruptableText } from "../../ui/React/CorruptableText";
import { makeAIMove, resolveCurrentTurn } from "../boardAnalysis/goAI";
import { makeAIMove, resetAI, resolveCurrentTurn } from "../boardAnalysis/goAI";
import { GoScoreExplanation } from "./GoScoreExplanation";
interface GoGameboardWrapperProps {
@@ -144,6 +144,7 @@ export function GoGameboardWrapper({ showInstructions }: GoGameboardWrapperProps
}
Go.currentGame = getNewBoardState(newBoardSize, newOpponent, true);
resetAI(false);
rerender();
resolveCurrentTurn();
}