diff --git a/www/js/game.js b/www/js/game.js index b17d808..45f6735 100644 --- a/www/js/game.js +++ b/www/js/game.js @@ -501,7 +501,7 @@ GAME.Game = class { pieces_blocking += 2; // Move is only valid if pieces are swappable. - if(this.movement_swappable(piece, target, mask, dist, tile)) { + if(dist == 1 && this.movement_swappable(piece, target, mask, tile)) { swap = true; } else { result = false; @@ -560,7 +560,7 @@ GAME.Game = class { return tiles; } - movement_swappable(piece, target, mask, range, tile) { + movement_swappable(piece, target, mask, tile) { if(piece.piece == target.piece && piece.promoted == target.promoted) { return false; } @@ -574,7 +574,7 @@ GAME.Game = class { && (this.board.tiles[tile].threaten[+(!target.player)] > 0 || piece.blocking != 0)) { return false; } - return ((moves.direction & mask) != 0 && (range == 1 || (moves.stride & mask) != 0)); + return (moves.direction & mask) != 0; } movement_tiles_alt(piece) {