diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1c30a5ac..c0c7e5ff 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -396,10 +396,9 @@ namespace { // Penalty when trapped by the king, even more if the king cannot castle else if (mob <= 3) { - Square ksq = pos.square(Us); + File kf = file_of(pos.square(Us)); - if ( ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq))) - && !pe->semiopen_side(Us, file_of(ksq), file_of(s) < file_of(ksq))) + if ((kf < FILE_E) == (file_of(s) < kf)) score -= (TrappedRook - make_score(mob * 22, 0)) * (1 + !pos.can_castle(Us)); } } diff --git a/src/pawns.h b/src/pawns.h index a9c21ffb..669999bf 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -45,10 +45,6 @@ struct Entry { return semiopenFiles[c] & (1 << f); } - int semiopen_side(Color c, File f, bool leftSide) const { - return semiopenFiles[c] & (leftSide ? (1 << f) - 1 : ~((1 << (f + 1)) - 1)); - } - int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][bool(DarkSquares & s)]; }