Skip to content

Commit

Permalink
Remove conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Nov 22, 2024
1 parent 7a86eec commit 6b2780a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ static partial class EvaluationParams
/// <summary>
/// <see cref="Utils.Pack(1, 2)"/>
/// </summary>
public const int KnightAttacksRooksBonus = 131073;
public const int KnightAttacksQueenBonus = 131073;

}
4 changes: 2 additions & 2 deletions src/Lynx/Model/Position.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ private int KnightAdditionalEvaluation(int squareIndex, int pieceSide, int oppos
packedBonus += CheckBonus[(int)Piece.N] * checks;

// Attacks to enemy rooks
var rookAttacksCount = (attacks & PieceBitBoards[(int)Piece.r - Utils.PieceOffset(pieceSide)]).CountBits();
packedBonus += KnightAttacksRooksBonus * rookAttacksCount;
var queenAttacksCount = (attacks & PieceBitBoards[(int)Piece.q - Utils.PieceOffset(pieceSide)]).CountBits();
packedBonus += KnightAttacksQueenBonus * queenAttacksCount;

return packedBonus;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Lynx/TunableEvalParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6044,7 +6044,7 @@ public static partial class EvaluationParams
private static readonly int _PieceAttackedByPawnPenalty;

[GeneratedPack(1, 2)]
private static readonly int _KnightAttacksRooksBonus;
private static readonly int _KnightAttacksQueenBonus;

#pragma warning restore IDE0051, IDE0052, CS0169 // Remove unread private members

Expand Down

0 comments on commit 6b2780a

Please sign in to comment.