diff --git a/src/Lynx/Lynx.csproj b/src/Lynx/Lynx.csproj index c65d87401..ad42c9d24 100644 --- a/src/Lynx/Lynx.csproj +++ b/src/Lynx/Lynx.csproj @@ -19,7 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/Lynx/Model/Position.cs b/src/Lynx/Model/Position.cs index 8d7f6ca15..6edd141af 100644 --- a/src/Lynx/Model/Position.cs +++ b/src/Lynx/Model/Position.cs @@ -123,13 +123,6 @@ public GameState MakeMove(Move move) int piece = move.Piece(); int promotedPiece = move.PromotedPiece(); - // King (and castling) moves require calculating king buckets twice, so skipping incremetal eval for those cases for now - _isIncrementalEval = _isIncrementalEval - && !(piece == (int)Piece.K - || piece == (int)Piece.k - //|| move.IsCastle() // Not needed for now, see CastlingMovesAreKingMoves test - ); - var newPiece = piece; if (promotedPiece != default) { @@ -166,6 +159,10 @@ public GameState MakeMove(Move move) } else if (piece == (int)Piece.K || piece == (int)Piece.k) { + // King (and castling) moves require calculating king buckets twice and recalculating all related parameters, so skipping incremental eval for those cases for now + // No need to check for move.IsCastle(), see CastlingMovesAreKingMoves test + _isIncrementalEval = false; + _kingPawnUniqueIdentifier ^= sourcePieceHash ^ targetPieceHash;