X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSynchrone2.js;h=ee016844521d47b6354488964aaf8921cf096d72;hb=715f705c877510885be243c84f62722f6136abbe;hp=00d68ad7597f7e7a32177e3bf81eb57db7a22a09;hpb=aa32568ef0c9fff28d17d19588b53ee049f0e1dc;p=vchess.git diff --git a/client/src/variants/Synchrone2.js b/client/src/variants/Synchrone2.js index 00d68ad7..ee016844 100644 --- a/client/src/variants/Synchrone2.js +++ b/client/src/variants/Synchrone2.js @@ -5,7 +5,7 @@ import { randInt } from "@/utils/alea"; export class Synchrone2Rules extends Synchrone1Rules { static get CanAnalyze() { - return true;//false; + return false; } static get HasEnpassant() { @@ -199,7 +199,17 @@ export class Synchrone2Rules extends Synchrone1Rules { this.turn = V.GetOppCol(this.turn); this.movesCount--; if (this.movesCount % 4 == 0) this.initfenStack.pop(); - if (move.vanish.length > 0) super.postUndo(move); + this.postUndo(move); + } + + postUndo(move) { + if (this.turn == 'w') { + // Reset king positions: scan board (TODO: could be more efficient) + if (move.vanish.length > 0) this.scanKings(); + // Also reset whiteMove + this.whiteMove = null; + } + else this.whiteMove = move.whiteMove; } getCurrentScore() {