X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=98e79df2a82d2d661c9af66aa8d8004466da1bab;hp=dceaa5a4bc331d2240f98269c7e037f524888826;hb=dc2302b701083dade07d59b1ffbfd180d47c4383;hpb=268c12bf31f347d7cc9e9b5b8d5fc0bbcc445bc5 diff --git a/src/position.cpp b/src/position.cpp index dceaa5a4..98e79df2 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -675,10 +675,12 @@ bool Position::move_is_check(Move m, Bitboard dcCandidates) const { /// Position::move_is_capture() tests whether a move from the current -/// position is a capture. +/// position is a capture. Move must not be MOVE_NONE. bool Position::move_is_capture(Move m) const { + assert(m != MOVE_NONE); + return ( !square_is_empty(move_to(m)) && (color_of_piece_on(move_to(m)) == opposite_color(side_to_move())) )