diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 297d8c65..9ebd8748 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -257,6 +257,7 @@ namespace { attackedBy[Us][PAWN] = pe->pawn_attacks(Us); attackedBy[Us][ALL_PIECES] = attackedBy[Us][KING] | attackedBy[Us][PAWN]; attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN]; + kingRing[Us] = kingAttackersCount[Them] = 0; // Init our king safety tables only if we are going to use them diff --git a/src/search.cpp b/src/search.cpp index 07680f1d..e113068c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -944,10 +944,8 @@ moves_loop: // When in check, search starts from here && pos.see_ge(move)) extension = ONE_PLY; - // Extension for king moves that change castling rights - if ( pos.can_castle(us) - && type_of(movedPiece) == KING - && depth < 12 * ONE_PLY) + else if ( pos.can_castle(us) // Extension for king moves that change castling rights + && type_of(movedPiece) == KING) extension = ONE_PLY; // Calculate new depth for this move