Almost added TitanChess + EvolutionChess
[vchess.git] / client / src / variants / Castle.js
index af3710c..cf44ba5 100644 (file)
@@ -1,12 +1,16 @@
 import { ChessRules } from "@/base_rules";
 
 export class CastleRules extends ChessRules {
+
   getCurrentScore() {
     const baseScore = super.getCurrentScore();
     if (baseScore != '*') return baseScore;
-    if (this.getPiece(0,2) == V.KING && this.getPiece(0,3) == V.ROOK)
-      return "0-1";
-    if (this.castleFlags['b'][0] >= 8) return "1-0";
+    if (this.castleFlags['b'][0] >= 8) {
+      if (this.getPiece(0,2) == V.KING && this.getPiece(0,3) == V.ROOK)
+        return "0-1";
+      return "1-0";
+    }
     return '*';
   }
+
 };