From: Benjamin Auder Date: Wed, 6 Jan 2021 16:17:28 +0000 (+0100) Subject: Small fixes X-Git-Url: https://git.auder.net/doc/%7B%7B%20path%28%27fos_user_profile_show%27%29%20%7D%7D?a=commitdiff_plain;h=6cc34165a3ca6dcad86030c96df8c0f49c1fabad;p=vchess.git Small fixes --- diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 0f18dbec..b8f05060 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -158,7 +158,7 @@ export const ChessRules = class ChessRules { // Turn "p" into "bp" (for board) static fen2board(f) { - return f.charCodeAt() <= 90 ? "w" + f.toLowerCase() : "b" + f; + return f.charCodeAt(0) <= 90 ? "w" + f.toLowerCase() : "b" + f; } // Check if FEN describes a board situation correctly diff --git a/client/src/variants/Pacosako.js b/client/src/variants/Pacosako.js index c6f466f1..ae4fe6ff 100644 --- a/client/src/variants/Pacosako.js +++ b/client/src/variants/Pacosako.js @@ -34,6 +34,11 @@ export class PacosakoRules extends ChessRules { }; } + static fen2board(f) { + // Underscore is character 95, in file w_ + return f.charCodeAt() <= 95 ? "w" + f.toLowerCase() : "b" + f; + } + static IsGoodPosition(position) { if (position.length == 0) return false; const rows = position.split("/"); diff --git a/client/src/variants/Screen.js b/client/src/variants/Screen.js index 0a8a75e2..41334da0 100644 --- a/client/src/variants/Screen.js +++ b/client/src/variants/Screen.js @@ -12,10 +12,6 @@ export class ScreenRules extends ChessRules { return false; } - get showFirstTurn() { - return true; - } - get canAnalyze() { return this.movesCount >= 2; }