projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Swap variant
[vchess.git]
/
client
/
src
/
variants
/
Swap.js
diff --git
a/client/src/variants/Swap.js
b/client/src/variants/Swap.js
index
bf4e787
..
071b21d
100644
(file)
--- a/
client/src/variants/Swap.js
+++ b/
client/src/variants/Swap.js
@@
-71,7
+71,7
@@
export class SwapRules extends ChessRules {
const color = this.turn;
const piece = this.getPiece(x, y);
const addSmoves = (i, j) => {
const color = this.turn;
const piece = this.getPiece(x, y);
const addSmoves = (i, j) => {
- if (this.getPiece(i, j) != piece)
+ if (this.getPiece(i, j) != piece
|| this.getColor(i, j) != color
)
Array.prototype.push.apply(moves, this.getSwapMoves([x, y], [i, j]));
};
switch (piece) {
Array.prototype.push.apply(moves, this.getSwapMoves([x, y], [i, j]));
};
switch (piece) {