mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Simplify pawn threats and merge into ThreatenedByPawn[]
Tested in no-regression mode, passed STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 14477 W: 2493 L: 2362 D: 9622 and LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 51964 W: 7091 L: 7013 D: 37860 bench: 7875814
This commit is contained in:
@@ -147,7 +147,7 @@ namespace {
|
|||||||
// ThreatenedByPawn[PieceType] contains a penalty according to which piece
|
// ThreatenedByPawn[PieceType] contains a penalty according to which piece
|
||||||
// type is attacked by an enemy pawn.
|
// type is attacked by an enemy pawn.
|
||||||
const Score ThreatenedByPawn[] = {
|
const Score ThreatenedByPawn[] = {
|
||||||
S(0, 0), S(0, 0), S(56, 70), S(56, 70), S(76, 99), S(86, 118)
|
S(0, 0), S(0, 0), S(80, 119), S(80, 119), S(117, 199), S(127, 218)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hanging contains a bonus for each enemy hanging piece
|
// Hanging contains a bonus for each enemy hanging piece
|
||||||
@@ -506,7 +506,7 @@ namespace {
|
|||||||
// Add a bonus according if the attacking pieces are minor or major
|
// Add a bonus according if the attacking pieces are minor or major
|
||||||
if (weakEnemies)
|
if (weakEnemies)
|
||||||
{
|
{
|
||||||
b = weakEnemies & (ei.attackedBy[Us][PAWN] | ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
|
b = weakEnemies & (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
|
||||||
if (b)
|
if (b)
|
||||||
score += Threat[0][type_of(pos.piece_on(lsb(b)))];
|
score += Threat[0][type_of(pos.piece_on(lsb(b)))];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user