X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=7d0cde2146dc29e50a905f0090cf9378b1269943;hp=e20c822f5998902ba2149d13504bd9846a1833d0;hb=06eba14dc984dc793e959ff7a5de19e1a190112b;hpb=c5de4080dba8e9b3248f06bd6c168c22e9fbfd92 diff --git a/src/position.cpp b/src/position.cpp index e20c822f..7d0cde21 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1192,6 +1192,7 @@ bool Position::pos_is_ok(int* failedStep) const { } if (step == Lists) + { for (Piece pc : Pieces) { if (pieceCount[pc] != popcount(pieces(color_of(pc), type_of(pc)))) @@ -1201,6 +1202,9 @@ bool Position::pos_is_ok(int* failedStep) const { if (board[pieceList[pc][i]] != pc || index[pieceList[pc][i]] != i) return false; } + if (pieceCount[PAWN] > FILE_NB) + return false; + } if (step == Castling) for (Color c = WHITE; c <= BLACK; ++c)