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