X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fposition.cpp;h=e73e1e5dc3a2dd99b119b35cb0549106f289e14b;hb=3ee3cdc09b2d52a17f5db4b7ecb0fcc64c27ccd6;hp=a9bf1f1288baf3232781836951347bb11a038196;hpb=7dd0c39714cbb6829d7cbf9da36fa46995e7a61e;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index a9bf1f12..e73e1e5d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1053,7 +1053,7 @@ void Position::do_promotion_move(Move m, UndoInfo &u) { from = move_from(m); to = move_to(m); - assert(pawn_rank(us, to) == RANK_8); + assert(relative_rank(us, to) == RANK_8); assert(this->piece_on(from) == pawn_of_color(us)); assert(this->color_of_piece_on(to) == them || this->square_is_empty(to)); @@ -1179,7 +1179,7 @@ void Position::do_ep_move(Move m) { capsq = (us == WHITE)? (to - DELTA_N) : (to - DELTA_S); assert(to == epSquare); - assert(pawn_rank(us, to) == RANK_6); + assert(relative_rank(us, to) == RANK_6); assert(this->piece_on(to) == EMPTY); assert(this->piece_on(from) == pawn_of_color(us)); assert(this->piece_on(capsq) == pawn_of_color(them)); @@ -1418,7 +1418,7 @@ void Position::undo_promotion_move(Move m, const UndoInfo &u) { from = move_from(m); to = move_to(m); - assert(pawn_rank(us, to) == RANK_8); + assert(relative_rank(us, to) == RANK_8); assert(this->piece_on(from) == EMPTY); // Remove promoted piece: @@ -1500,7 +1500,7 @@ void Position::undo_ep_move(Move m) { capsq = (us == WHITE)? (to - DELTA_N) : (to - DELTA_S); assert(to == this->ep_square()); - assert(pawn_rank(us, to) == RANK_6); + assert(relative_rank(us, to) == RANK_6); assert(this->piece_on(to) == pawn_of_color(us)); assert(this->piece_on(from) == EMPTY); assert(this->piece_on(capsq) == EMPTY); @@ -2182,7 +2182,7 @@ bool Position::is_ok() const { if(this->ep_square() != SQ_NONE) { // The en passant square must be on rank 6, from the point of view of the // side to move. - if(pawn_rank(this->side_to_move(), this->ep_square()) != RANK_6) + if(relative_rank(this->side_to_move(), this->ep_square()) != RANK_6) return false; }