Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix trapped rook condition

A rook is trapped if on rank 1 as is the king.

bench: 4696542
  • Loading branch information...
commit 2593f7fa37109838fea860cd332e94144ca775d8 1 parent 3b92159
@mcostalba authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/evaluate.cpp
View
2  src/evaluate.cpp
@@ -651,7 +651,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
bool left = file_of(ksq) < FILE_E;
if ( ((left && file_of(s) < file_of(ksq)) || (!left && 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_on_side(Us, file_of(ksq), left)))
score -= make_score(pos.can_castle(Us) ? (TrappedRookPenalty - mob * 16) / 2
: (TrappedRookPenalty - mob * 16), 0);
Please sign in to comment.
Something went wrong with that request. Please try again.