From: Benjamin Auder Date: Tue, 24 Mar 2020 18:39:29 +0000 (+0100) Subject: Some other fixes X-Git-Url: https://git.auder.net/variants/Checkered/vendor/css/current/gitweb.css?a=commitdiff_plain;h=58bf4670c6bf01d94fe1f798cd5d63493d15e196;p=vchess.git Some other fixes --- 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 =>