File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -642,17 +642,17 @@ Value do_evaluate(const Position& pos, Value& margin) {
642642 score += RookHalfOpenFileBonus;
643643 }
644644
645- // Penalize rooks which are trapped inside a king. Penalize more if
646- // king has lost right to castle.
647645 if (mob > 6 || ei.pi ->file_is_half_open (Us, f))
648646 continue ;
649647
650648 ksq = pos.king_square (Us);
651- bool left = file_of (ksq) < FILE_E;
652649
653- if ( ((left && file_of (s) < file_of (ksq)) || (!left && file_of (s) > file_of (ksq)))
654- && (relative_rank (Us, ksq) == RANK_1 && rank_of (ksq) == rank_of (s))
655- && (!ei.pi ->has_open_file_on_side (Us, file_of (ksq), left)))
650+ // Penalize rooks which are trapped inside a king. Penalize more if
651+ // king has lost right to castle.
652+ if ( ((file_of (ksq) < FILE_E) == (file_of (s) < file_of (ksq)))
653+ && rank_of (ksq) == rank_of (s)
654+ && relative_rank (Us, ksq) == RANK_1
655+ && !ei.pi ->has_open_file_on_side (Us, file_of (ksq), file_of (ksq) < FILE_E))
656656 score -= make_score (pos.can_castle (Us) ? (TrappedRookPenalty - mob * 16 ) / 2
657657 : (TrappedRookPenalty - mob * 16 ), 0 );
658658 }
You can’t perform that action at this time.
0 commit comments