Speed-up for CTF variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 23 Jan 2020 18:25:59 +0000 (19:25 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 23 Jan 2020 18:25:59 +0000 (19:25 +0100)
racingkings STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 576 W: 235 L: 151 D: 190
http://www.variantfishtest.org:6543/tests/view/5e28c2806e23db46beba4cc8

kingofthehill STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 842 W: 410 L: 309 D: 123
http://www.variantfishtest.org:6543/tests/view/5e28c2726e23db46beba4cc5

src/evaluate.cpp

index e552fe0..86f383a 100644 (file)
@@ -892,7 +892,7 @@ namespace {
             {
                 Square s2 = pop_lsb(&target_squares);
                 int dist =  distance(s1, s2)
-                          + (isKingCTF ? popcount(pos.attackers_to(s2) & pos.pieces(Them)) : 0)
+                          + (isKingCTF ? popcount(pos.attackers_to(s2, Them)) : 0)
                           + !!(pos.pieces(Us) & s2);
                 score += make_score(2500, 2500) / (1 + scale * dist * dist);
             }