projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove castling as an option to escape from check in Allmate variants
[vchess.git]
/
client
/
src
/
variants
/
Allmate2.js
diff --git
a/client/src/variants/Allmate2.js
b/client/src/variants/Allmate2.js
index
31d41be
..
9ba91ef
100644
(file)
--- a/
client/src/variants/Allmate2.js
+++ b/
client/src/variants/Allmate2.js
@@
-61,7
+61,12
@@
export class Allmate2Rules extends ChessRules {
oppMoves = this.getPotentialQueenMoves([i, j]);
break;
case V.KING:
oppMoves = this.getPotentialQueenMoves([i, j]);
break;
case V.KING:
- oppMoves = this.getPotentialKingMoves([i, j]);
+ // Do not allow castling to escape from check
+ oppMoves = super.getSlideNJumpMoves(
+ sq,
+ V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
+ "oneStep"
+ );
break;
}
for (let om of oppMoves) {
break;
}
for (let om of oppMoves) {