projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Titan
[vchess.git]
/
client
/
src
/
variants
/
Titan.js
diff --git
a/client/src/variants/Titan.js
b/client/src/variants/Titan.js
index
836acc1
..
4d71b85
100644
(file)
--- a/
client/src/variants/Titan.js
+++ b/
client/src/variants/Titan.js
@@
-228,11
+228,20
@@
export class TitanRules extends ChessRules {
}
postPlay(move) {
}
postPlay(move) {
- if (this.movesCount > 4) super.postPlay(move);
+ if (this.movesCount > 4) {
+ let piece = move.vanish[0].p;
+ if (['j', 'l'].includes(piece)) piece = V.KING;
+ if (piece == V.KING)
+ this.kingPos[move.appear[0].c] = [move.appear[0].x, move.appear[0].y];
+ this.updateCastleFlags(move, piece);
+ }
}
postUndo(move) {
}
postUndo(move) {
- if (this.movesCount >= 4) super.postUndo(move);
+ if (this.movesCount >= 4) {
+ if (['j', 'k', 'l'].includes(this.getPiece(move.start.x, move.start.y)))
+ this.kingPos[move.vanish[0].c] = [move.start.x, move.start.y];
+ }
}
evalPosition() {
}
evalPosition() {