mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Simplify code, delete else after return
This commit is contained in:
parent
f3cd7002aa
commit
445aade39c
1 changed files with 7 additions and 9 deletions
|
@ -652,17 +652,15 @@ ScaleFactor Endgame<KBPKB>::operator()(const Position& pos) const {
|
|||
|
||||
if (relative_rank(strongSide, pawnSq) <= RANK_5)
|
||||
return SCALE_FACTOR_DRAW;
|
||||
else
|
||||
{
|
||||
Bitboard path = forward_bb(strongSide, pawnSq);
|
||||
|
||||
Bitboard path = forward_bb(strongSide, pawnSq);
|
||||
|
||||
if (path & pos.pieces(weakSide, KING))
|
||||
return SCALE_FACTOR_DRAW;
|
||||
if (path & pos.pieces(weakSide, KING))
|
||||
return SCALE_FACTOR_DRAW;
|
||||
|
||||
if ( (pos.attacks_from<BISHOP>(weakBishopSq) & path)
|
||||
&& distance(weakBishopSq, pawnSq) >= 3)
|
||||
return SCALE_FACTOR_DRAW;
|
||||
}
|
||||
if ( (pos.attacks_from<BISHOP>(weakBishopSq) & path)
|
||||
&& distance(weakBishopSq, pawnSq) >= 3)
|
||||
return SCALE_FACTOR_DRAW;
|
||||
}
|
||||
return SCALE_FACTOR_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue