IPVGO: Ensure getValidMoves correctly handles playing as white (#2292)

This commit is contained in:
Michael Ficocelli
2025-08-22 16:12:09 -04:00
committed by GitHub
parent b025a4d0c1
commit 02f2f1be74
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ export function NetscriptGo(): InternalAPI<NSGo> {
return getValidMoves(undefined, true);
}
const playAsWhite = helpers.boolean(ctx, "playAsWhite", _playAsWhite ?? false);
const State = validateBoardState(error(ctx), _boardState, _priorBoardState);
const State = validateBoardState(error(ctx), _boardState, _priorBoardState, playAsWhite);
return getValidMoves(State, playAsWhite);
},
getChains: (ctx) => (_boardState) => {