projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Coregal variant + simplify time management in Game.vue
[vchess.git]
/
client
/
src
/
variants
/
Cannibal.js
diff --git
a/client/src/variants/Cannibal.js
b/client/src/variants/Cannibal.js
index
1508f67
..
7860ab0
100644
(file)
--- a/
client/src/variants/Cannibal.js
+++ b/
client/src/variants/Cannibal.js
@@
-166,7
+166,8
@@
export class CannibalRules extends ChessRules {
getAllValidMoves() {
const moves = super.getAllValidMoves();
getAllValidMoves() {
const moves = super.getAllValidMoves();
- if (moves.some(m => m.vanish.length == 2)) return V.KeepCaptures(moves);
+ if (moves.some(m => m.vanish.length == 2 && m.appear.length == 1))
+ return V.KeepCaptures(moves);
return moves;
}
return moves;
}
@@
-180,7
+181,7
@@
export class CannibalRules extends ChessRules {
this.castleFlags[c] = [V.size.y, V.size.y];
return;
}
this.castleFlags[c] = [V.size.y, V.size.y];
return;
}
- super.updateCastleFlags(move);
+ super.updateCastleFlags(move
, piece
);
}
postUndo(move) {
}
postUndo(move) {