mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 17:49:35 +00:00
Fix KpsK endgame
Broken by commit a44c5cf4f7
of 3 /12 / 2011 that
was labeled "No functional change" because our 'bench'
test didn't triggered that particular endgame. Indeed
we need to run a specific bench on a set of endgames
position when touching endgame.cpp because normal bench
does not cover endgames properly.
Found by MSVC 2012 code analyzer.
This commit is contained in:
parent
e0035e9ca9
commit
4b7dbb3922
1 changed files with 2 additions and 2 deletions
|
@ -648,7 +648,7 @@ ScaleFactor Endgame<KPsK>::operator()(const Position& pos) const {
|
||||||
// Does the defending king block the pawns?
|
// Does the defending king block the pawns?
|
||||||
if ( square_distance(ksq, relative_square(strongerSide, SQ_A8)) <= 1
|
if ( square_distance(ksq, relative_square(strongerSide, SQ_A8)) <= 1
|
||||||
|| ( file_of(ksq) == FILE_A
|
|| ( file_of(ksq) == FILE_A
|
||||||
&& !in_front_bb(strongerSide, ksq) & pawns))
|
&& !(in_front_bb(strongerSide, ksq) & pawns)))
|
||||||
return SCALE_FACTOR_DRAW;
|
return SCALE_FACTOR_DRAW;
|
||||||
}
|
}
|
||||||
// Are all pawns on the 'h' file?
|
// Are all pawns on the 'h' file?
|
||||||
|
@ -657,7 +657,7 @@ ScaleFactor Endgame<KPsK>::operator()(const Position& pos) const {
|
||||||
// Does the defending king block the pawns?
|
// Does the defending king block the pawns?
|
||||||
if ( square_distance(ksq, relative_square(strongerSide, SQ_H8)) <= 1
|
if ( square_distance(ksq, relative_square(strongerSide, SQ_H8)) <= 1
|
||||||
|| ( file_of(ksq) == FILE_H
|
|| ( file_of(ksq) == FILE_H
|
||||||
&& !in_front_bb(strongerSide, ksq) & pawns))
|
&& !(in_front_bb(strongerSide, ksq) & pawns)))
|
||||||
return SCALE_FACTOR_DRAW;
|
return SCALE_FACTOR_DRAW;
|
||||||
}
|
}
|
||||||
return SCALE_FACTOR_NONE;
|
return SCALE_FACTOR_NONE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue