From de9e4580cc3953e6b13b5ec775ce9f3a0b21e1a0 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Fri, 15 Jan 2021 23:23:55 +0100 Subject: [PATCH] Football: fixing attempt --- client/src/variants/Football.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) { -- 2.44.0