- // King attack and mobility
- evaluate_common(p, b, us, ei, KnightAttackWeight,
- MidgameKnightMobilityBonus, EndgameKnightMobilityBonus);
-
- // Knight outposts:
- if(p.square_is_weak(s, them)) {
- Value v, bonus;
-
- // Initial bonus based on square:
- v = bonus = KnightOutpostBonus[relative_square(us, s)];
-
- // Increase bonus if supported by pawn, especially if the opponent has
- // no minor piece which can exchange the outpost piece:
- if(v && p.pawn_attacks(them, s) & p.pawns(us)) {
- bonus += v/2;
- if(p.knight_count(them) == 0 &&
- (SquaresByColorBB[square_color(s)] &
- p.bishops(them)) == EmptyBoardBB) {
- bonus += v;
- }
- }
-
- ei.mgValue += Sign[us] * bonus;
- ei.egValue += Sign[us] * bonus;
- }
+ // King attack, mobility and outposts
+ evaluate_common(p, b, us, ei, KnightAttackWeight, MidgameKnightMobilityBonus,
+ EndgameKnightMobilityBonus, s, KnightOutpostBonus);