IPVGO: Do not update captures on passed analysis boards (#2415)

This commit is contained in:
Michael Ficocelli
2025-12-21 16:44:24 -05:00
committed by GitHub
parent 49e231fd41
commit 4218b01dfb
8 changed files with 127 additions and 20 deletions
+5 -4
View File
@@ -114,13 +114,14 @@ export function NetscriptGo(): InternalAPI<NSGo> {
const resetAll = helpers.boolean(ctx, "resetAll", _resetAll ?? false);
resetStats(resetAll);
},
setTestingBoardState: (ctx) => (_boardState, _komi) => {
const State = validateBoardState(ctx, _boardState);
setTestingBoardState: (ctx) => (_boardState, _komi, _nextPlayerIsWhite) => {
const nextPlayerIsWhite = helpers.boolean(ctx, "nextPlayerIsWhite", _nextPlayerIsWhite ?? false);
const State = validateBoardState(ctx, _boardState, null, nextPlayerIsWhite);
if (!State) {
throw errorMessage(ctx, "Invalid board state passed to setTestingBoardState()");
}
const komi: number | undefined = _komi !== undefined ? helpers.number(ctx, "komi", _komi) : undefined;
return setTestingBoardState(ctx, State.board, komi);
const komi = helpers.number(ctx, "komi", _komi ?? 5.5);
return setTestingBoardState(ctx, State, komi);
},
highlightPoint: (ctx) => (_x, _y, _color, _text) => {
const x = helpers.number(ctx, "x", _x);