Fix Loser chess
authorBenjamin Auder <benjamin.auder@somewhere>
Sat, 1 Dec 2018 12:27:57 +0000 (13:27 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sat, 1 Dec 2018 12:27:57 +0000 (13:27 +0100)
public/javascripts/variants/Loser.js

index 0ed3edc..b4d8b4f 100644 (file)
@@ -2,13 +2,15 @@ class LoserRules extends ChessRules
 {
        initVariables(fen)
        {
-               // No castling, hence no flags; but flags defined for compatibility
-               this.flags = "-";
                const epSq = this.moves.length > 0 ? this.getEpSquare(this.lastMove) : undefined;
                this.epSquares = [ epSq ];
        }
 
-       setFlags(fen) { }
+       setFlags(fen)
+       {
+               // No castling, hence no flags; but flags defined for compatibility
+               this.castleFlags = "0000";
+       }
 
        getPotentialPawnMoves([x,y])
        {