]> git.sesse.net Git - stockfish/commitdiff
Revert trapped rook bug fix
authorMarco Costalba <mcostalba@gmail.com>
Tue, 14 May 2013 22:06:11 +0000 (00:06 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 14 May 2013 22:06:11 +0000 (00:06 +0200)
It seems that do  not limiting checking the
trapped rook only on rank 1 improves the
score.

At long TC
LLR: 2.97 (-2.94,2.94)
Total: 6581 W: 1346 L: 1204 D: 4031

bench: 4985012

src/evaluate.cpp

index 6b590c7842976cdc4c99a689d5af7011e1f6f3f2..607694e00a23dac1d632d03dab44c75dfe12c47b 100644 (file)
@@ -600,8 +600,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
             // Penalize rooks which are trapped inside a king. Penalize more if
             // king has lost right to castle.
             if (   ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq)))
             // Penalize rooks which are trapped inside a king. Penalize more if
             // king has lost right to castle.
             if (   ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq)))
-                && rank_of(ksq) == rank_of(s)
-                && relative_rank(Us, ksq) == RANK_1
+                && (rank_of(ksq) == rank_of(s) || relative_rank(Us, ksq) == RANK_1)
                 && !ei.pi->half_open_on_side(Us, file_of(ksq), file_of(ksq) < FILE_E))
                 score -= (TrappedRookPenalty - make_score(mob * 8, 0)) * (pos.can_castle(Us) ? 1 : 2);
         }
                 && !ei.pi->half_open_on_side(Us, file_of(ksq), file_of(ksq) < FILE_E))
                 score -= (TrappedRookPenalty - make_score(mob * 8, 0)) * (pos.can_castle(Us) ? 1 : 2);
         }