From e00bb13e8540058987ccfb8006f164acfd0acdcf Mon Sep 17 00:00:00 2001 From: homoSapiensSapiens Date: Fri, 3 May 2013 14:01:41 +0300 Subject: [PATCH] Merge some conditions No functional change. Signed-off-by: Marco Costalba --- src/evaluate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 5a8a292f..1a1334fe 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -651,19 +651,19 @@ Value do_evaluate(const Position& pos, Value& margin) { if ( file_of(ksq) >= FILE_E && file_of(s) > file_of(ksq) - && (relative_rank(Us, ksq) == RANK_1 || rank_of(ksq) == rank_of(s))) + && (relative_rank(Us, ksq) == RANK_1 || rank_of(ksq) == rank_of(s)) + && !ei.pi->has_open_file_to_right(Us, file_of(ksq))) { // Is there a half-open file between the king and the edge of the board? - if (!ei.pi->has_open_file_to_right(Us, file_of(ksq))) score -= make_score(pos.can_castle(Us) ? (TrappedRookPenalty - mob * 16) / 2 : (TrappedRookPenalty - mob * 16), 0); } else if ( file_of(ksq) <= FILE_D && file_of(s) < file_of(ksq) - && (relative_rank(Us, ksq) == RANK_1 || rank_of(ksq) == rank_of(s))) + && (relative_rank(Us, ksq) == RANK_1 || rank_of(ksq) == rank_of(s)) + && !ei.pi->has_open_file_to_left(Us, file_of(ksq))) { // Is there a half-open file between the king and the edge of the board? - if (!ei.pi->has_open_file_to_left(Us, file_of(ksq))) score -= make_score(pos.can_castle(Us) ? (TrappedRookPenalty - mob * 16) / 2 : (TrappedRookPenalty - mob * 16), 0); } -- 2.39.2