X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=8ce7acdeac154a8905525eae4afe27f35052af2a;hb=e9b0b5043dc87ebc6857c255e2202a215912c4d9;hp=fbeef895522204565f4ab050f9bcf4bd12fff3c4;hpb=1af00c56319683edd9215457b2c84840215399ab;p=vchess.git diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index fbeef895..8ce7acde 100644 --- 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: - let newAppear = []; - let newVanish = []; moves.forEach(m => { + let newAppear = []; + let newVanish = []; 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); }); - 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;