From 6cc34165a3ca6dcad86030c96df8c0f49c1fabad Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 6 Jan 2021 17:17:28 +0100
Subject: [PATCH] Small fixes

---
 client/src/base_rules.js        | 2 +-
 client/src/variants/Pacosako.js | 5 +++++
 client/src/variants/Screen.js   | 4 ----
 3 files changed, 6 insertions(+), 5 deletions(-)

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;
   }
-- 
2.44.0