- this.getColor(i, j) != oppCol &&
- this.getPotentialMovesFrom([i, j]).some(m =>
- // Warning: discard castle moves
- m.vanish.length == 2 && m.appear.length == 1)
+ this.getColor(i, j) == color &&
+ this.getPotentialMovesFrom([i, j]).some(m => {
+ return (
+ // Warning: discard castle moves
+ m.vanish.length == 2 && m.appear.length == 1 &&
+ this.filterValid([m]).length == 1
+ );
+ })