X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.c;h=2cd57e5b1d99f23af6815ba755150e1a52ae09b1;hb=learn;hp=06753200fb0514a988362d75a1d6b4cc530b8b93;hpb=fada9d0d1c35f22ebd5706e3f54127624ad7a380;p=polyglot.git diff --git a/uci.c b/uci.c index 0675320..2cd57e5 100644 --- a/uci.c +++ b/uci.c @@ -953,13 +953,17 @@ static void parse_score(uci_t * uci, const char string[]) { static int mate_score(int dist) { + int ms = option_get_int(Option,"MateScore"); + ASSERT(dist!=0); if (FALSE) { + } else if (ms == 0) { + return (dist > 0 ? 100000 + dist : -100000 + dist); } else if (dist > 0) { - return +option_get_int(Option,"MateScore") - (+dist) * 2 + 1; + return +ms - (+dist) * 2 + 1; } else if (dist < 0) { - return -option_get_int(Option,"MateScore") + (-dist) * 2; + return -ms + (-dist) * 2; } return 0;