projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Alice rules (en passant)
[vchess.git]
/
client
/
src
/
base_rules.js
diff --git
a/client/src/base_rules.js
b/client/src/base_rules.js
index
734af02
..
ec949fc
100644
(file)
--- a/
client/src/base_rules.js
+++ b/
client/src/base_rules.js
@@
-80,6
+80,11
@@
export const ChessRules = class ChessRules {
return V.ShowMoves;
}
return V.ShowMoves;
}
+ // Used for Monochrome variant (TODO: harmonize: !canFlip ==> showFirstTurn)
+ get showFirstTurn() {
+ return false;
+ }
+
// Some variants always show the same orientation
static get CanFlip() {
return true;
// Some variants always show the same orientation
static get CanFlip() {
return true;
@@
-802,7
+807,6
@@
export const ChessRules = class ChessRules {
this.getEnpassantCaptures([x, y], pawnShiftX)
);
}
this.getEnpassantCaptures([x, y], pawnShiftX)
);
}
-
return pMoves;
}
return pMoves;
}
@@
-990,7
+994,7
@@
export const ChessRules = class ChessRules {
const color = this.turn;
for (let i = 0; i < V.size.x; i++) {
for (let j = 0; j < V.size.y; j++) {
const color = this.turn;
for (let i = 0; i < V.size.x; i++) {
for (let j = 0; j < V.size.y; j++) {
- if (this.getColor(i, j) == color) {
+ if (this.
board[i][j] != V.EMPTY && this.
getColor(i, j) == color) {
const moves = this.getPotentialMovesFrom([i, j]);
if (moves.length > 0) {
for (let k = 0; k < moves.length; k++) {
const moves = this.getPotentialMovesFrom([i, j]);
if (moves.length > 0) {
for (let k = 0; k < moves.length; k++) {