// pawns on h6, g5, black pawns on h7, g6, f7).
// Kingside and queenside pawn storms
- bool outPost = (outpost_mask(us, s) & theirPawns);
- bool passed = (passed_pawn_mask(us, s) & theirPawns);
int KBonus = KStormTable[relative_square(us, s)];
int QBonus = QStormTable[relative_square(us, s)];
+ bool outPost = (KBonus > 0 && (outpost_mask(us, s) & theirPawns));
+ bool passed = (QBonus > 0 && (passed_pawn_mask(us, s) & theirPawns));
switch (f) {
case FILE_A:
- QBonus += passed * QBonus / 4;
+ QBonus += passed * QBonus / 2;
break;
case FILE_B:
|| isolated
|| chain
|| (pos.pawn_attacks(us, s) & theirPawns)
- || (ourPawns & in_front_bb(them, r) & neighboring_files_bb(f)))
+ || (ourPawns & behind_bb(us, r) & neighboring_files_bb(f)))
backward = false;
else
{
// Test for candidate passed pawn
candidate = !passed
&& pos.file_is_half_open(them, f)
- && ( count_1s_max_15(neighboring_files_bb(f) & (in_front_bb(them, r) | rank_bb(r)) & ourPawns)
- - count_1s_max_15(neighboring_files_bb(f) & in_front_bb(us, r) & theirPawns)
+ && ( count_1s_max_15(neighboring_files_bb(f) & (behind_bb(us, r) | rank_bb(r)) & ourPawns)
+ - count_1s_max_15(neighboring_files_bb(f) & in_front_bb(us, r) & theirPawns)
>= 0);
// In order to prevent doubled passed pawns from receiving a too big