X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FFootball.js;fp=client%2Fsrc%2Fvariants%2FFootball.js;h=09af0f7626663119da009214f726044078ecf288;hb=de9e4580cc3953e6b13b5ec775ce9f3a0b21e1a0;hp=98e2372ea9a1708c036a564e8a332711fe583f44;hpb=5c6c52ac1c7bbb2a58c60bf5f389e1be4b76b0c1;p=vchess.git diff --git a/client/src/variants/Football.js b/client/src/variants/Football.js index 98e2372e..09af0f76 100644 --- a/client/src/variants/Football.js +++ b/client/src/variants/Football.js @@ -235,7 +235,7 @@ export class FootballRules extends ChessRules { } } const kickedFrom = x + "-" + y; - moves.forEach(m => m.by = kickedFrom) + moves.forEach(m => m.start.by = kickedFrom) return moves; } @@ -346,7 +346,7 @@ export class FootballRules extends ChessRules { filterValid(moves) { const L = this.kickedBy.length; const kb = this.kickedBy[L-1]; - return moves.filter(m => !m.by || !kb[m.by]); + return moves.filter(m => !m.start.by || !kb[m.start.by]); } getCheckSquares() { @@ -393,9 +393,9 @@ export class FootballRules extends ChessRules { } else { this.subTurn++; - if (!!move.by) { + if (!!move.start.by) { const L = this.kickedBy.length; - this.kickedBy[L-1][move.by] = true; + this.kickedBy[L-1][move.start.by] = true; } } } @@ -409,9 +409,9 @@ export class FootballRules extends ChessRules { } else { this.subTurn--; - if (!!move.by) { + if (!!move.start.by) { const L = this.kickedBy.length; - delete this.kickedBy[L-1][move.by]; + delete this.kickedBy[L-1][move.start.by]; } } if (!passesOver) {