X-Git-Url: https://git.auder.net/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fbase_rules.js;h=326da6ed01a3230d7f2539c9540756fe141ce000;hb=b0a0468aa6f436f2ad4962492561ef430a3bc15c;hp=890601d2d4458a0b454b228d53209bb5576ad8fe;hpb=3a2a7b5fd3c6bfd0752838094c27e1fb6172d109;p=vchess.git diff --git a/client/src/base_rules.js b/client/src/base_rules.js index 890601d2..326da6ed 100644 --- a/client/src/base_rules.js +++ b/client/src/base_rules.js @@ -238,9 +238,11 @@ export const ChessRules = class ChessRules { // On which squares is color under check ? (for interface) getCheckSquares(color) { - return this.isAttacked(this.kingPos[color], [V.GetOppCol(color)]) - ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! - : []; + return ( + this.underCheck(color) + ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! + : [] + ); } /////////////