patch Game service

Bug where player passes were submitted before `game` object was assigned within `Game.makeMove` patched
This commit is contained in:
Sorrel 2020-07-20 12:20:47 -04:00 committed by GitHub
parent 14a94be59e
commit 27cf281670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,11 +266,12 @@ const Game = ({ gameData = {}, gameRecord = [] } = {}) => {
if (this.pass > 1) {
return { ...this, success: false };
}
if (x === 0) return game.submitPass(player);
let success = false;
let game = this;
if (x === 0) return game.submitPass(player);
// if checkMove has not been run, determine legality
if (!game.move) {
game = game.checkMove({ player, pos: { x, y } });