X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.h;h=65bfa25807f4eb2af0ac95a3565f589ae18c5ec5;hb=412d68fe4f3e32b3314141a861554e18940ff556;hp=d2b37478e4ce681714fc11b654986da82a016209;hpb=683595fee15a1d8ceeb1bbd577d96ed9c0f8aaaa;p=stockfish diff --git a/src/position.h b/src/position.h index d2b37478..65bfa258 100644 --- a/src/position.h +++ b/src/position.h @@ -718,5 +718,14 @@ inline bool Position::has_pawn_on_7th(Color c) const { return pawns(c) & relative_rank_bb(c, RANK_7); } +inline bool Position::move_is_capture(Move m) const { + + // Move must not be MOVE_NONE ! + + return ( !square_is_empty(move_to(m)) + && (color_of_piece_on(move_to(m)) != color_of_piece_on(move_from(m))) + ) + || move_is_ep(m); +} #endif // !defined(POSITION_H_INCLUDED)