projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'update'
[vchess.git]
/
client
/
src
/
variants
/
Eightpieces.js
diff --git
a/client/src/variants/Eightpieces.js
b/client/src/variants/Eightpieces.js
index
a799cff
..
f040a83
100644
(file)
--- a/
client/src/variants/Eightpieces.js
+++ b/
client/src/variants/Eightpieces.js
@@
-666,7
+666,10
@@
export const VariantRules = class EightpiecesRules extends ChessRules {
this.castleFlags[oppCol][flagIdx] = false;
}
this.castleFlags[oppCol][flagIdx] = false;
}
- if (this.subTurn == 2) {
+ if (move.appear.length == 0 && move.vanish.length == 1) {
+ // The sentry is about to push a piece:
+ this.sentryPos = { x: move.end.x, y: move.end.y };
+ } else if (this.subTurn == 2) {
// A piece is pushed: forbid array of squares between start and end
// of move, included (except if it's a pawn)
let squares = [];
// A piece is pushed: forbid array of squares between start and end
// of move, included (except if it's a pawn)
let squares = [];
@@
-707,19
+710,17
@@
export const VariantRules = class EightpiecesRules extends ChessRules {
this.epSquares.push(this.getEpSquare(move));
V.PlayOnBoard(this.board, move);
if (this.subTurn == 1) this.movesCount++;
this.epSquares.push(this.getEpSquare(move));
V.PlayOnBoard(this.board, move);
if (this.subTurn == 1) this.movesCount++;
- if (move.appear.length == 0 && move.vanish.length == 1) {
- // The sentry is about to push a piece:
- this.sentryPos = { x: move.end.x, y: move.end.y };
+ if (move.appear.length == 0 && move.vanish.length == 1)
this.subTurn = 2;
this.subTurn = 2;
-
}
else {
+ else {
// Turn changes only if not a sentry "pre-push"
this.turn = V.GetOppCol(this.turn);
this.subTurn = 1;
// Turn changes only if not a sentry "pre-push"
this.turn = V.GetOppCol(this.turn);
this.subTurn = 1;
- const L = this.sentryPush.length;
- // Is it a sentry push? (useful for undo)
- move.sentryPush = !!this.sentryPush[L-1];
}
this.updateVariables(move);
}
this.updateVariables(move);
+ const L = this.sentryPush.length;
+ // Is it a sentry push? (useful for undo)
+ move.sentryPush = !!this.sentryPush[L-1];
}
undo(move) {
}
undo(move) {