- const stepSpec =
- this.pieces(args.oppCol, i, j)[this.getPieceType(i, j)];
+ const apparentPiece = this.getPiece(i, j);
+ // Quick check: does this potential attacker target x,y ?
+ if (this.canStepOver(x, y, apparentPiece))
+ continue;
+ const allSpecs = this.pieces(args.oppCol, i, j);
+ let stepSpec = allSpecs[this.getPieceType(i, j)];
+ if (stepSpec.moveas)
+ stepSpec = allSpecs[stepSpec.moveas];