X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=5a98821d493dde10d9fe2bd020ba17467c1d7ea5;hp=efc71db89e015a4c8df6746fca181b4c9aa0a985;hb=a66c73deef420104e74b6645ee60e20b37fd8549;hpb=dc130042831cdb52994aa8165b1cf8f49eef8640 diff --git a/src/position.cpp b/src/position.cpp index efc71db8..5a98821d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -149,6 +149,7 @@ void Position::init() { for (int cr = NO_CASTLING; cr <= ANY_CASTLING; ++cr) { + Zobrist::castling[cr] = 0; Bitboard b = cr; while (b) { @@ -684,12 +685,6 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const { /// to a StateInfo object. The move is assumed to be legal. Pseudo-legal /// moves should be filtered out before this function is called. -void Position::do_move(Move m, StateInfo& newSt) { - - CheckInfo ci(*this); - do_move(m, newSt, gives_check(m, ci)); -} - void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { assert(is_ok(m)); @@ -848,7 +843,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { // Update the key with the final value st->key = k; - // Calculate checkers bitboard (if move is check) + // Calculate checkers bitboard (if move gives check) st->checkersBB = givesCheck ? attackers_to(king_square(them)) & pieces(us) : 0; sideToMove = ~sideToMove; @@ -1084,8 +1079,8 @@ Value Position::see(Move m) const { } -/// Position::is_draw() tests whether the position is drawn by material, 50 moves -/// rule or repetition. It does not detect stalemates. +/// Position::is_draw() tests whether the position is drawn by 50-move rule +/// or by repetition. It does not detect stalemates. bool Position::is_draw() const {