X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=c98a83fc81a777806b111d80200946eaeb271da7;hp=4c10a199243730db00ab89a471ee4ac393b99e5a;hb=213166ba225bcefbbe7dbecdacfd726dfb6c34f9;hpb=d6252ef202f43d42d05b80145f3014da4d22863e;ds=sidebyside diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 4c10a199..c98a83fc 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -794,9 +794,8 @@ namespace { Color strongSide = eg > VALUE_DRAW ? WHITE : BLACK; int sf = me->scale_factor(pos, strongSide); - // If we don't already have an unusual scale factor, check for certain - // types of endgames, and use a lower scale for those. - if (sf == SCALE_FACTOR_NORMAL || sf == SCALE_FACTOR_ONEPAWN) + // If scale is not already specific, scale down the endgame via general heuristics + if (sf == SCALE_FACTOR_NORMAL) { if (pos.opposite_bishops()) { @@ -810,12 +809,8 @@ namespace { else sf = 46; } - // Endings where weaker side can place his king in front of the enemy's - // pawns are drawish. - else if ( abs(eg) <= BishopValueEg - && pos.count(strongSide) <= 2 - && !pos.pawn_passed(~strongSide, pos.square(~strongSide))) - sf = 37 + 7 * pos.count(strongSide); + else + sf = std::min(40 + 7 * pos.count(strongSide), sf); } return ScaleFactor(sf);