- 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][V.PAWN]++;
- else if (move.vanish.length == 2) this.reserve[color][move.vanish[1].p]++;
- }
-
- unupdateVariables(move) {
- super.unupdateVariables(move);
+ if (move.vanish.length == 2) {
+ if (V.PawnSpecs.promotions.includes(move.vanish[1].p))
+ this.reserve[color][V.PAWN]++;
+ else this.reserve[color][move.vanish[1].p]++;
+ }
+ }
+
+ postUndo(move) {
+ super.postUndo(move);