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();
// 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)
{
RepetitionPositionHistory.Clear();
if (!inSearch)
{
RepetitionPositionHistory.Clear();
}
newFiftyMoveCounter = 0;
}