]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Introduce captured_piece()
[stockfish] / src / position.cpp
index 2508db669dfb2241ed0e4c322fbfb6fbd8d0cfe0..f24c2f2c0c3d72c1bb332b5589bdc71f6edd0781 100644 (file)
@@ -1301,11 +1301,6 @@ void Position::undo_null_move() {
 }
 
 
-///
-PieceType Position::captured_piece() const {
-  return st->capture;
-}
-
 /// Position::see() is a static exchange evaluator: It tries to estimate the
 /// material gain or loss resulting from a move. There are three versions of
 /// this function: One which takes a destination square as input, one takes a
@@ -1678,6 +1673,7 @@ Value Position::compute_non_pawn_material(Color c) const {
 /// Position::is_draw() tests whether the position is drawn by material,
 /// repetition, or the 50 moves rule. It does not detect stalemates, this
 /// must be done by the search.
+// FIXME: Currently we are not handling 50 move rule correctly when in check
 
 bool Position::is_draw() const {
 
@@ -1691,7 +1687,7 @@ bool Position::is_draw() const {
       return true;
 
   // Draw by repetition?
-  for (int i = 2; i < Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2)
+  for (int i = 4; i <= Min(Min(gamePly, st->rule50), st->pliesFromNull); i += 2)
       if (history[gamePly - i] == st->key)
           return true;