]> git.sesse.net Git - stockfish/commitdiff
Extension for king moves changing castling rights
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 3 Nov 2018 14:03:39 +0000 (15:03 +0100)
committerStéphane Nicolet <cassio@free.fr>
Thu, 8 Nov 2018 15:20:23 +0000 (16:20 +0100)
passed STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 8463 W: 1919 L: 1747 D: 4797
http://tests.stockfishchess.org/tests/view/5be15d510ebc595e0ae2dec6

passed LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 142590 W: 23263 L: 22587 D: 96740
http://tests.stockfishchess.org/tests/view/5be1667b0ebc595e0ae2df2d

Bench: 3607243

src/search.cpp

index c9526ec3c683e38a013089dfcd98bb661f3f2c0e..8a32e827488739ea351a4ee77d0532138b578ffa 100644 (file)
@@ -943,6 +943,12 @@ moves_loop: // When in check, search starts from here
                &&  pos.see_ge(move))
           extension = ONE_PLY;
 
+      // Extension for king moves that change castling rights
+      if (   type_of(movedPiece) == KING
+          && pos.can_castle(us)
+          && depth < 12 * ONE_PLY)
+          extension = ONE_PLY;
+
       // Calculate new depth for this move
       newDepth = depth - ONE_PLY + extension;