projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Knightmate2: detect commoner attacks
[vchess.git]
/
client
/
src
/
variants
/
Zen.js
diff --git
a/client/src/variants/Zen.js
b/client/src/variants/Zen.js
index
808d543
..
7edbe40
100644
(file)
--- a/
client/src/variants/Zen.js
+++ b/
client/src/variants/Zen.js
@@
-1,6
+1,7
@@
import { ChessRules } from "@/base_rules";
export class ZenRules extends ChessRules {
import { ChessRules } from "@/base_rules";
export class ZenRules extends ChessRules {
+
getEpSquare(moveOrSquare) {
if (!moveOrSquare) return undefined;
if (typeof moveOrSquare === "string") {
getEpSquare(moveOrSquare) {
if (!moveOrSquare) return undefined;
if (typeof moveOrSquare === "string") {
@@
-78,6
+79,7
@@
export class ZenRules extends ChessRules {
}
if (
V.OnBoard(i, j) &&
}
if (
V.OnBoard(i, j) &&
+ this.board[i][j] != V.EMPTY &&
this.getColor(i, j) == oppCol &&
this.getPiece(i, j) == asA
) {
this.getColor(i, j) == oppCol &&
this.getPiece(i, j) == asA
) {
@@
-87,7
+89,8
@@
export class ZenRules extends ChessRules {
promotionPieces.forEach(p => {
moves.push(this.getBasicMove([x, y], [i, j], { c: color, p: p }));
});
promotionPieces.forEach(p => {
moves.push(this.getBasicMove([x, y], [i, j], { c: color, p: p }));
});
- } else {
+ }
+ else {
// All other cases
moves.push(this.getBasicMove([x, y], [i, j]));
}
// All other cases
moves.push(this.getBasicMove([x, y], [i, j]));
}
@@
-161,4
+164,5
@@
export class ZenRules extends ChessRules {
k: 1000
};
}
k: 1000
};
}
+
};
};