Fix blocking on non-stride.

This commit is contained in:
yukirij 2024-08-20 11:28:30 -07:00
parent f2468621b2
commit 804074c0c5

View File

@ -480,7 +480,8 @@ GAME.Game = class {
if(target.piece == GAME.Const.PieceId.Omen) { if(target.piece == GAME.Const.PieceId.Omen) {
if(valid) { if(valid) {
check = true; check = true;
block = mask;
if(stride) { block = mask; }
// Apply check to previous moves. // Apply check to previous moves.
for(let idist = 1; idist < dist; idist++) { for(let idist = 1; idist < dist; idist++) {
@ -488,7 +489,7 @@ GAME.Game = class {
} }
} }
if(pieces_blocking == 1) { if(pieces_blocking == 1 && stride) {
// Apply blocking to last . // Apply blocking to last .
for(let idist = 1; idist < dist; idist++) { for(let idist = 1; idist < dist; idist++) {
if(this.board.tiles[tiles[tiles.length - idist].tile].piece !== null) { if(this.board.tiles[tiles[tiles.length - idist].tile].piece !== null) {