]> git.sesse.net Git - stockfish/commitdiff
Fix in ok_to_history(): castle move is not a capture
authorMarco Costalba <mcostalba@gmail.com>
Mon, 10 Nov 2008 18:04:15 +0000 (19:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 10 Nov 2008 18:19:40 +0000 (19:19 +0100)
It is erroneusly considered a capture because king
moves on the same square of the rook.

Use the correct function Position::move_is_capture()
instead of the open coded (and buggy) one.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 5b4913c3d3dcdbe733ec30c92e8f90f152843c7a..e28b866e9cb26b2bc26c5bc5460a6e091aa2ef81 100644 (file)
@@ -2155,13 +2155,11 @@ namespace {
 
 
   // ok_to_history() returns true if a move m can be stored
-  // in history. Should be a non capturing move.
+  // in history. Should be a non capturing move nor a promotion.
 
   bool ok_to_history(const Position& pos, Move m) {
 
-    return    pos.square_is_empty(move_to(m))
-          && !move_promotion(m)
-          && !move_is_ep(m);
+    return !pos.move_is_capture(m) && !move_promotion(m);
   }