X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=a09fe68337d8aa7ab3bbbd5f93dc86023e901fc1;hp=965d1ea387f47352fb5cb5773219cd6a01ef0c6d;hb=07b45151d2f7abfac7030f3bf401a36b5b8c7b8b;hpb=67aac4889ea3bfa5880883d8b81dbb457741b7c2 diff --git a/src/pawns.cpp b/src/pawns.cpp index 965d1ea3..a09fe683 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -244,15 +244,15 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { // 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: @@ -300,7 +300,7 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { || 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 { @@ -324,8 +324,8 @@ PawnInfo *PawnInfoTable::get_pawn_info(const Position &pos) { // 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