X-Git-Url: https://git.auder.net/pieces/Cwda/n_black_bishop.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=7a42a385bba0514b125192572327195c355f06c7;hb=4f7723a1a0d1554f16c699017ae308079aa43a69;hp=8b8165a0685ef5f189cc83a1bc1daa36d42707ee;hpb=26c1e3bd4d3e9fb7c86e25c0f423bea57b977111;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 8b8165a0..7a42a385 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -956,11 +956,11 @@ class ChessRules board[psq.x][psq.y] = psq.c + psq.p; } - // Before move is played, update variables + flags + // After move is played, update variables + flags updateVariables(move) { const piece = move.vanish[0].p; - const c = move.vanish[0].c; + const c = this.getOppCol(this.turn); //'move.vanish[0].c' doesn't work for Checkered const firstRank = (c == "w" ? V.size.x-1 : 0); // Update king position + flags