mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Merge some conditions
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
3b41e62666
commit
e00bb13e85
1 changed files with 4 additions and 4 deletions
|
@ -651,19 +651,19 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||||
|
|
||||||
if ( file_of(ksq) >= FILE_E
|
if ( file_of(ksq) >= FILE_E
|
||||||
&& file_of(s) > file_of(ksq)
|
&& 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?
|
// 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
|
score -= make_score(pos.can_castle(Us) ? (TrappedRookPenalty - mob * 16) / 2
|
||||||
: (TrappedRookPenalty - mob * 16), 0);
|
: (TrappedRookPenalty - mob * 16), 0);
|
||||||
}
|
}
|
||||||
else if ( file_of(ksq) <= FILE_D
|
else if ( file_of(ksq) <= FILE_D
|
||||||
&& file_of(s) < file_of(ksq)
|
&& 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?
|
// 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
|
score -= make_score(pos.can_castle(Us) ? (TrappedRookPenalty - mob * 16) / 2
|
||||||
: (TrappedRookPenalty - mob * 16), 0);
|
: (TrappedRookPenalty - mob * 16), 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue