From: Benjamin Auder Date: Fri, 15 Jan 2021 22:23:55 +0000 (+0100) Subject: Football: fixing attempt X-Git-Url: https://git.auder.net/img/css/current/rpsls.js?a=commitdiff_plain;h=de9e4580cc3953e6b13b5ec775ce9f3a0b21e1a0;p=vchess.git Football: fixing attempt --- 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) {