X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=a19f346d92328049d477e04701053de4bc413d21;hp=f18968ceb86ed5960c01acdd44084ca9256a476d;hb=cd782c11ec8e765e3a323e422cea19d7d053a07c;hpb=5ea984ac3515946d952bd3c9cfe8e8baef7cc85d diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f18968ce..a19f346d 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -391,7 +391,7 @@ Value do_evaluate(const Position& pos, Value& margin) { { // Check for KBP vs KB with only a single pawn that is almost // certainly a draw or at least two pawns. - bool one_pawn = (pos.piece_count(WHITE, PAWN) + pos.piece_count(BLACK, PAWN) == 1); + bool one_pawn = (pos.count(WHITE) + pos.count(BLACK) == 1); sf = one_pawn ? ScaleFactor(8) : ScaleFactor(32); } else @@ -440,8 +440,7 @@ Value do_evaluate(const Position& pos, Value& margin) { ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us); // Init king safety tables only if we are going to use them - if ( pos.piece_count(Us, QUEEN) - && pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) + if (pos.count(Us) && pos.non_pawn_material(Us) > QueenValueMg + PawnValueMg) { ei.kingRing[Them] = b | shift_bb(b); b &= ei.attackedBy[Us][PAWN]; @@ -488,7 +487,7 @@ Value do_evaluate(const Position& pos, Value& margin) { Score score = SCORE_ZERO; const Color Them = (Us == WHITE ? BLACK : WHITE); - const Square* pl = pos.piece_list(Us, Piece); + const Square* pl = pos.list(Us); ei.attackedBy[Us][Piece] = 0;