X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FHorde.js;h=c436811b0f457fb7e26fab88b44d1ecfc0adf607;hb=1d67d9611c52fbe667cea39f68098f4e52464223;hp=6305c412a5b1ebde239b8e8f669a677ed9a49c76;hpb=5a187b07e221493931cf089bf85ef6db41d8b775;p=vchess.git diff --git a/client/src/variants/Horde.js b/client/src/variants/Horde.js index 6305c412..c436811b 100644 --- a/client/src/variants/Horde.js +++ b/client/src/variants/Horde.js @@ -24,7 +24,7 @@ export class HordeRules extends ChessRules { } sumElts++; } else { - const num = parseInt(row[i]); + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -51,8 +51,8 @@ export class HordeRules extends ChessRules { return super.filterValid(moves); } - getCheckSquares(color) { - if (color == 'w') return []; + getCheckSquares() { + if (this.turn == 'w') return []; return ( this.underCheck('b') ? [JSON.parse(JSON.stringify(this.kingPos['b']))]