From 58bf4670c6bf01d94fe1f798cd5d63493d15e196 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Tue, 24 Mar 2020 19:39:29 +0100 Subject: [PATCH] Some other fixes --- client/src/variants/Schess.js | 6 +----- client/src/variants/Suction.js | 2 +- client/src/views/Variants.vue | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/client/src/variants/Schess.js b/client/src/variants/Schess.js index d2e35288..ba5730e6 100644 --- a/client/src/variants/Schess.js +++ b/client/src/variants/Schess.js @@ -33,10 +33,6 @@ export class SchessRules extends ChessRules { return b; } - // TODO: maybe changes could be done to this method to show "empty" - // instead of a piece to not use a pocket piece... -// getPPpath(b) { } - static IsGoodFen(fen) { if (!ChessRules.IsGoodFen(fen)) return false; const fenParsed = V.ParseFen(fen); @@ -193,7 +189,7 @@ export class SchessRules extends ChessRules { } shift = (m.appear[0].p == V.NOTHING ? 1 : 0); if ( - m.appear.length >= 2 && + m.appear.length >= 2 + shift && m.vanish.length == 2 && ![m.appear[shift].y, m.appear[shift+1].y].includes(m.vanish[1].y) ) { diff --git a/client/src/variants/Suction.js b/client/src/variants/Suction.js index 2038e4f8..aa28f596 100644 --- a/client/src/variants/Suction.js +++ b/client/src/variants/Suction.js @@ -96,7 +96,7 @@ export class SuctionRules extends ChessRules { Math.abs(epSquare.y - y) == 1 ) { let enpassantMove = this.getBasicMove([x, y], [epSquare.x, epSquare.y]); - const oppCol = V.GetOppCol(color); + const oppCol = V.GetOppCol(this.turn); enpassantMove.vanish.push({ x: x, y: epSquare.y, diff --git a/client/src/views/Variants.vue b/client/src/views/Variants.vue index 2a3f6cf0..e5d02856 100644 --- a/client/src/views/Variants.vue +++ b/client/src/views/Variants.vue @@ -26,6 +26,9 @@ export default { st: store.state }; }, + mounted: function() { + document.getElementById("prefixFilter").focus(); + }, computed: { filteredVariants: function() { const capitalizedPrefix = this.curPrefix.replace(/^\w/, c => -- 2.44.0