]> git.sesse.net Git - stockfish/commitdiff
Relax constrain in connected_moves()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 3 Nov 2012 12:25:23 +0000 (13:25 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 3 Nov 2012 12:34:04 +0000 (13:34 +0100)
When testing if a piece is moving through the squares
vacated by a previous move there is no reason to require
the piece to be a slider, indeed we can have a double
pawn push like in this example:

r1q2rk1/2p1bppp/2Pp4/pN5b/Q1P1p3/4B2P/PP1R1PP1/1K5R w - - 3 18

Where black's move f5 is connected to previous move Be7 that
frees the path.

Or we can have a castle move:

r1bqkb1r/pppp1ppp/2n1pn2/1B6/4P3/2N2N2/PPPP1PPP/R1BQK2R b KQkq - 5 1

Where a previous move Bb5 allows the white to castle king side.

This time patch is mine ;-)

new bench: 5809010

src/search.cpp

index 978a5993b584147ed0be06d5a2e8091b77a5da52..afdd204964b3272ba32f8b1653caa3c0c1bf93cc 100644 (file)
@@ -1378,7 +1378,7 @@ split_point_start: // At split points actual search starts from here
         return true;
 
     // Moving through the vacated square
-    if (piece_is_slider(pos.piece_on(f2)) && (between_bb(f2, t2) & f1))
+    if (between_bb(f2, t2) & f1)
       return true;
 
     // The destination square for m2 is defended by the moving piece in m1