Fix fifty move counter not updating correctly during search

This commit is contained in:
Sebastian Lague 2023-07-22 20:33:46 +02:00
parent 8ed36b9205
commit 8281130c9a

View file

@ -266,9 +266,12 @@ namespace ChessChallenge.Chess
UpdateSliderBitboards(); UpdateSliderBitboards();
// Pawn moves and captures reset the fifty move counter and clear 3-fold repetition history // Pawn moves and captures reset the fifty move counter and clear 3-fold repetition history
if (!inSearch && (movedPieceType == PieceHelper.Pawn || capturedPieceType != PieceHelper.None)) if (movedPieceType == PieceHelper.Pawn || capturedPieceType != PieceHelper.None)
{
if (!inSearch)
{ {
RepetitionPositionHistory.Clear(); RepetitionPositionHistory.Clear();
}
newFiftyMoveCounter = 0; newFiftyMoveCounter = 0;
} }