Fix a detail in Loser's flags
authorBenjamin Auder <benjamin.auder@somewhere>
Sat, 8 Dec 2018 02:28:01 +0000 (03:28 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sat, 8 Dec 2018 02:28:01 +0000 (03:28 +0100)
public/javascripts/base_rules.js
public/javascripts/variants/Loser.js

index ee5ddd0..172f68b 100644 (file)
@@ -1076,7 +1076,7 @@ class ChessRules
                for (let i of ['w','b'])
                {
                        for (let j=0; j<2; j++)
-                               fen += this.castleFlags[i][j] ? '1' : '0';
+                               fen += (this.castleFlags[i][j] ? '1' : '0');
                }
                return fen;
        }
index b4d8b4f..936c259 100644 (file)
@@ -9,7 +9,7 @@ class LoserRules extends ChessRules
        setFlags(fen)
        {
                // No castling, hence no flags; but flags defined for compatibility
-               this.castleFlags = "0000";
+               this.castleFlags = { "w":[false,false], "b":[false,false] };
        }
 
        getPotentialPawnMoves([x,y])
@@ -110,6 +110,11 @@ class LoserRules extends ChessRules
        unupdateVariables(move) { }
        parseFlags(flags) { }
 
+       getFlagsFen()
+       {
+               return "";
+       }
+
        checkGameEnd()
        {
                // No valid move: you win!