[IPvGO] Performance enhancement: async move option lookup (#1028)

This commit is contained in:
Michael Ficocelli
2024-01-09 18:46:01 -05:00
committed by GitHub
parent 6f8a59593a
commit 87c4cbbc57
4 changed files with 160 additions and 140 deletions

View File

@@ -59,6 +59,7 @@ export function NetscriptGo(): InternalAPI<Go> {
passTurn: (ctx: NetscriptContext) => async (): Promise<Play> => {
if (Player.go.boardState.previousPlayer === playerColors.black) {
helpers.log(ctx, () => `It is not your turn; you cannot pass.`);
helpers.log(ctx, () => `Do you have multiple scripts running, or did you forget to await makeMove() ?`);
return Promise.resolve(invalidMoveResponse);
}
return handlePassTurn(logger(ctx));