projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finish Pacosako + add GameStat table to know how many live games are played
[vchess.git]
/
client
/
src
/
base_rules.js
diff --git
a/client/src/base_rules.js
b/client/src/base_rules.js
index
770561b
..
6954952
100644
(file)
--- a/
client/src/base_rules.js
+++ b/
client/src/base_rules.js
@@
-275,7
+275,7
@@
export const ChessRules = class ChessRules {
// En-passant square, if any
getEpSquare(moveOrSquare) {
// En-passant square, if any
getEpSquare(moveOrSquare) {
- if (!moveOrSquare) return undefined;
+ if (!moveOrSquare) return undefined;
//TODO: necessary line?!
if (typeof moveOrSquare === "string") {
const square = moveOrSquare;
if (square == "-") return undefined;
if (typeof moveOrSquare === "string") {
const square = moveOrSquare;
if (square == "-") return undefined;
@@
-1073,7
+1073,8
@@
export const ChessRules = class ChessRules {
V.OnBoard(rx, ry) &&
this.board[rx][ry] != V.EMPTY &&
this.getPiece(rx, ry) == piece &&
V.OnBoard(rx, ry) &&
this.board[rx][ry] != V.EMPTY &&
this.getPiece(rx, ry) == piece &&
- this.getColor(rx, ry) == color
+ this.getColor(rx, ry) == color &&
+ this.canTake([rx, ry], [x, y])
) {
return true;
}
) {
return true;
}