Some simplifactions, a few fixes, update TODO
[vchess.git] / client / src / variants / Takenmake.js
index 7226863..9549c2a 100644 (file)
@@ -2,6 +2,7 @@ import { ChessRules } from "@/base_rules";
 import { randInt } from "@/utils/alea";
 
 export class TakenmakeRules extends ChessRules {
+
   setOtherVariables(fen) {
     super.setOtherVariables(fen);
     // Stack of "last move" only for intermediate captures
@@ -22,7 +23,7 @@ export class TakenmakeRules extends ChessRules {
     switch (asA || piece) {
       case V.PAWN:
         if (!asA || piece == V.PAWN)
-          moves = this.getPotentialPawnMoves([x, y]);
+          moves = super.getPotentialPawnMoves([x, y]);
         else {
           // Special case: we don't want promotion, since just moving like
           // a pawn, but I'm in fact not a pawn :)
@@ -131,7 +132,7 @@ export class TakenmakeRules extends ChessRules {
       this.kingPos[c][0] = move.appear[0].x;
       this.kingPos[c][1] = move.appear[0].y;
     }
-    super.updateCastleFlags(move, piece);
+    super.updateCastleFlags(move, piece, c);
   }
 
   undo(move) {
@@ -197,4 +198,5 @@ export class TakenmakeRules extends ChessRules {
     delete moves[mIdx]["next"];
     return [moves[mIdx], move2];
   }
+
 };