+ super.updateVariables(move);
+ if (move.vanish.length == 2 && move.appear.length == 2)
+ return; //skip castle
+ const color = this.turn;
+ const V = VariantRules;
+ if (move.vanish.length == 0)
+ {
+ this.reserve[color][move.appear[0].p]--;
+ return;
+ }
+ move.movePromoted = this.promoted[move.start.x][move.start.y];
+ move.capturePromoted = this.promoted[move.end.x][move.end.y]
+ this.promoted[move.start.x][move.start.y] = false;
+ this.promoted[move.end.x][move.end.y] = move.movePromoted
+ || (move.vanish[0].p == V.PAWN && move.appear[0].p != V.PAWN);
+ if (move.capturePromoted)
+ this.reserve[color][VariantRules.PAWN]++;
+ else if (move.vanish.length == 2)
+ this.reserve[color][move.vanish[1].p]++;