mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 15:54:09 +02:00
IPVGO: Remove current game history from savefile, re-implement superko (#1175)
This commit is contained in:
committed by
GitHub
parent
fc8958af83
commit
1e5f7184a2
@@ -300,11 +300,11 @@ export function getCurrentPlayer(): "None" | "White" | "Black" {
|
||||
* Find a move made by the previous player, if present.
|
||||
*/
|
||||
export function getPreviousMove(): [number, number] | null {
|
||||
if (Go.currentGame.passCount) {
|
||||
const priorBoard = Go.currentGame?.previousBoards[0];
|
||||
if (Go.currentGame.passCount || !priorBoard) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const priorBoard = Go.currentGame?.previousBoard;
|
||||
for (const rowIndexString in Go.currentGame.board) {
|
||||
const row = Go.currentGame.board[+rowIndexString] ?? [];
|
||||
for (const pointIndexString in row) {
|
||||
@@ -348,7 +348,7 @@ export function resetBoardState(error: (s: string) => void, opponent: GoOpponent
|
||||
}
|
||||
|
||||
const oldBoardState = Go.currentGame;
|
||||
if (oldBoardState.previousPlayer !== null && oldBoardState.previousBoard) {
|
||||
if (oldBoardState.previousPlayer !== null && oldBoardState.previousBoards.length) {
|
||||
resetWinstreak(oldBoardState.ai, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user