Fix knight alt move check.

This commit is contained in:
yukirij 2024-11-24 14:16:42 -08:00
parent ac5a189d13
commit e0e888f861
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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; }