diff --git a/www/js/game.js b/www/js/game.js index 6ff00ec..8b30524 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -391,7 +391,7 @@ GAME.Game = class { // Handle alt moves. if(play.source == 3) { switch(moves.alt) { - case 0: { + case 1: { piece.promoted = false; } break; } @@ -595,7 +595,7 @@ GAME.Game = class { // Check all tiles if not blocking. if(block_directions == 0) { for(let i = 0; i < GAME_DATA.board.tiles.length; ++i) { - if(this.placable_tile(piece, i)) { + if(this.placable_tile(piece, i, {check:false})) { tiles.push(new GAME.MovementTile(i, true, false, 0, 0)); } } @@ -758,9 +758,8 @@ GAME.Game = class { // Check if position puts king in check. let checking = false; - let movements = [ ]; + let movements = this.movement_tiles(piece, tile_id, true); if(params.check !== false) { - movements = this.movement_tiles(piece, tile_id, true); for(let movement of movements) { if(movement.check) { checking = true; diff --git a/www/js/interface.js b/www/js/interface.js index 234ffce..9d3f7f6 100644 --- a/www/js/interface.js +++ b/www/js/interface.js @@ -436,7 +436,7 @@ const INTERFACE = { } if(GAME_DATA.turn > 0 && (play.source < 2 || play.source == 3) && (play.to == i || ((play.source == 0 || play.source == 3) && play.from == i))) { ctx.fillStyle = INTERFACE.Color.HintPlay; - } else if(GAME_DATA.state.check != 0 && piece !== null && piece.piece == GAME.Const.PieceId.Source && piece.player == (GAME_DATA.turn & 1)) { + } else if(GAME_DATA.state.check != 0 && piece !== null && piece.piece == GAME.Const.PieceId.Heart && piece.player == (GAME_DATA.turn & 1)) { ctx.fillStyle = INTERFACE.Color.HintCheck; } switch(hover_state) {