From e0e888f861ab296b13474115d656fb08eb838a31 Mon Sep 17 00:00:00 2001 From: yukirij Date: Sun, 24 Nov 2024 14:16:42 -0800 Subject: [PATCH] Fix knight alt move check. --- game/src/lib.rs | 2 +- www/js/game.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/game/src/lib.rs b/game/src/lib.rs index be3d99e..f57e817 100644 --- a/game/src/lib.rs +++ b/game/src/lib.rs @@ -594,7 +594,7 @@ impl Game { // Knight 1 => { for tile_id in subject_tiles { - if self.board.tiles[tile_id as usize].piece.is_none() { + if self.can_drop(piece, tile_id, flags::IGNORE_CHECK | flags::IGNORE_EXTENT) { plays.push(PlayInfo { valid: true, threat: false, diff --git a/www/js/game.js b/www/js/game.js index ad91c23..01b8362 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -646,7 +646,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.board.tiles[i].piece === null) { + if(this.placable_tile(piece, tile_id, {check:false, extent:false})) { tiles.push(new GAME.MovementTile(i, true, false, 0, 0)); } } @@ -667,7 +667,7 @@ GAME.Game = class { if(HEX.is_valid_board(tile_hex)) { let tile_id = HEX.hex_to_tile(tile_hex); - if(this.board.tiles[tile_id].piece === null) { + if(this.placable_tile(piece, tile_id, {check:false, extent:false})) { tiles.push(new GAME.MovementTile(tile_id, true, false, 0, 0)); } } else { break; }