projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Benedict rules
[vchess.git]
/
client
/
src
/
variants
/
Benedict.js
diff --git
a/client/src/variants/Benedict.js
b/client/src/variants/Benedict.js
index
fbeef89
..
8ce7acd
100644
(file)
--- a/
client/src/variants/Benedict.js
+++ b/
client/src/variants/Benedict.js
@@
-140,9
+140,9
@@
export const VariantRules = class BenedictRules extends ChessRules {
// Get all moves from x,y without captures:
let moves = super.getPotentialMovesFrom([x, y]);
// Add flips:
// Get all moves from x,y without captures:
let moves = super.getPotentialMovesFrom([x, y]);
// Add flips:
- let newAppear = [];
- let newVanish = [];
moves.forEach(m => {
moves.forEach(m => {
+ let newAppear = [];
+ let newVanish = [];
V.PlayOnBoard(this.board, m);
// If castling, m.appear has 2 elements:
m.appear.forEach(a => {
V.PlayOnBoard(this.board, m);
// If castling, m.appear has 2 elements:
m.appear.forEach(a => {
@@
-164,9
+164,9
@@
export const VariantRules = class BenedictRules extends ChessRules {
newAppear.push(pipoA);
newVanish.push(pipoV);
});
newAppear.push(pipoA);
newVanish.push(pipoV);
});
- Array.prototype.push.apply(m.appear, newAppear);
- Array.prototype.push.apply(m.vanish, newVanish);
});
});
+ Array.prototype.push.apply(m.appear, newAppear);
+ Array.prototype.push.apply(m.vanish, newVanish);
V.UndoOnBoard(this.board, m);
});
return moves;
V.UndoOnBoard(this.board, m);
});
return moves;