diff --git a/www/js/game.js b/www/js/game.js index be64e80..54d0328 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -25,7 +25,7 @@ GAME.Board = class { let board = new GAME.Board(); for(let i = 0; i < this.tiles.length; ++i) { board.tiles[i] = this.tiles[i].clone(); } - for(let i = 0; i < this.pieces.length; ++i) { this.pieces.push(null); } + for(let i = 0; i < this.pieces.length; ++i) { board.pieces.push(null); } for(let i = 0; i < this.pieces.length; ++i) { if(this.pieces[i] !== null) { board.pieces[i] = this.pieces[i].clone(); diff --git a/www/js/interface.js b/www/js/interface.js index b8025dc..6c9d9c1 100644 --- a/www/js/interface.js +++ b/www/js/interface.js @@ -354,7 +354,7 @@ const INTERFACE = { INTERFACE.game_step(); - if(!event.ctrlKey) { + if(event.preventDefault !== undefined && !event.ctrlKey) { event.preventDefault(); } }, @@ -1773,7 +1773,7 @@ const INTERFACE = { }, auto_play() { - let bit = 1 << ((GAME_DATA.turn + GAME_DATA.config.rules.reverse) & 1); + let bit = 1 << (GAME_DATA.turn & 1); if((INTERFACE_DATA.Game.auto & bit) == 0 || GAME_DATA.state.checkmate) { return; } function state_score(state, player) { @@ -1920,7 +1920,7 @@ const INTERFACE = { return null; } - let result = determine_play(GAME_DATA, (GAME_DATA.turn + GAME_DATA.config.rules.reverse) & 1, 1); + let result = determine_play(GAME_DATA, GAME_DATA.turn & 1, 1); if(result !== null) { INTERFACE.process(result.play); } else {