20-add-negamax-eval-function #31
@@ -715,6 +715,14 @@ bool apply_move_on_copy(struct Board *in, struct Board *out, struct Move m) {
|
|||||||
in->castling_rights, m.piece, m.from, m.to, captured_pid
|
in->castling_rights, m.piece, m.from, m.to, captured_pid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Apply full and half move clock counts.
|
||||||
|
bool is_capture = (m.flags & MF_CAPTURE) || (m.flags & MF_ENPASSANT);
|
||||||
|
bool is_pawn = (m.piece == P) || (m.piece == p);
|
||||||
|
|
||||||
|
out->halfmove_clock = (is_capture || is_pawn) ? 0 : in->halfmove_clock + 1;
|
||||||
|
out->fullmove_number = in->fullmove_number + (in->side_to_move == BLACK);
|
||||||
|
|
||||||
// Side to move flips
|
// Side to move flips
|
||||||
out->side_to_move = opp;
|
out->side_to_move = opp;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user