1
0
Fork 0

Add bonuses for Minors attacking enemy pieces(except pawns) even when they are protected by enemy pawns.

Patch passed STC
LLR: 2.95 (-2.94,2.94) [-1.50,4.50]
Total: 8206 W: 1426 L: 1304 D: 5476

and LTC
LLR: 2.97 (-2.94,2.94) [0.00,6.00]
Total: 19534 W: 2821 L: 2640 D: 14073

Bench: 9942172
pull/13/merge
Ajith 2014-06-30 10:55:10 -04:00 committed by Gary Linscott
parent ffedfa3354
commit 6b354305e1
1 changed files with 9 additions and 1 deletions

View File

@ -496,9 +496,17 @@ namespace {
const Color Them = (Us == WHITE ? BLACK : WHITE);
Bitboard b, weakEnemies;
Bitboard b, weakEnemies, protectedEnemies;
Score score = SCORE_ZERO;
// Protected enemies
protectedEnemies = (pos.pieces(Them) ^ pos.pieces(Them,PAWN))
& ei.attackedBy[Them][PAWN]
& (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
if(protectedEnemies)
score += Threat[0][type_of(pos.piece_on(lsb(protectedEnemies)))];
// Enemies not defended by a pawn and under our attack
weakEnemies = pos.pieces(Them)
& ~ei.attackedBy[Them][PAWN]