- if (attacks_from<PAWN>(fenEpSquare, them) & pieces(PAWN, sideToMove))
- st->epSquare = fenEpSquare;
+ // Ignore if no capture is possible
+ Color them = opposite_color(sideToMove);
+ if (!(attacks_from<PAWN>(st->epSquare, them) & pieces(PAWN, sideToMove)))
+ st->epSquare = SQ_NONE;