Better temporary fix for off-turn move on checkmate.
This commit is contained in:
parent
7a508a58d7
commit
7a28de3744
@ -457,7 +457,6 @@ GAME.Game = class {
|
||||
|
||||
movement_tiles(piece, tile) {
|
||||
let tiles = [ ];
|
||||
if(this.state.code != 0) { return tiles; }
|
||||
|
||||
let moves = piece.moves();
|
||||
let hex = this.board.tiles[tile].hex;
|
||||
@ -478,7 +477,7 @@ GAME.Game = class {
|
||||
if((dir_mask & 0xFFF) == 0) { dir_mask >>= 12; }
|
||||
|
||||
// Get initial status in direction.
|
||||
let valid = true;
|
||||
let valid = this.state.code == 0;
|
||||
let pieces_blocking = 0;
|
||||
|
||||
let move_hex = hex.copy();
|
||||
@ -617,7 +616,6 @@ GAME.Game = class {
|
||||
|
||||
movement_tiles_alt(piece) {
|
||||
let tiles = [ ];
|
||||
if(this.state.code != 0) { return tiles; }
|
||||
|
||||
if(piece.promoted) {
|
||||
let hex = this.board.tiles[piece.tile].hex;
|
||||
@ -802,7 +800,7 @@ GAME.Game = class {
|
||||
}
|
||||
|
||||
// Piece must have movements and not put king in check.
|
||||
if(position_valid && movements.length > 0 && !checking) {
|
||||
if(this.state.code == 0 && position_valid && movements.length > 0 && !checking) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user