X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=6f652c0a150c209a27b2f84478951cda4f46fccf;hp=a48dc13e7219422f1385f0d273f156842be70c20;hb=78908b7aed41ba0a70c557182ab1b27792db9b0c;hpb=e9296d694c72c2378b71ad29cfff2f2c7b45bb0c diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a48dc13e..6f652c0a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -714,7 +714,7 @@ namespace { b = undefended & ei.attackedBy[Them][ROOK] & ~pos.pieces(Them); // Consider only squares where the enemy rook gives check - b &= RookPseudoAttacks[ksq]; + b &= PseudoAttacks[ROOK][ksq]; if (b) { @@ -887,7 +887,7 @@ namespace { for (c = WHITE; c <= BLACK; c++) { // Skip if other side has non-pawn pieces - if (pos.non_pawn_material(flip(c))) + if (pos.non_pawn_material(~c)) continue; b = ei.pi->passed_pawns(c); @@ -900,7 +900,7 @@ namespace { // Compute plies to queening and check direct advancement movesToGo = rank_distance(s, queeningSquare) - int(relative_rank(c, s) == RANK_2); - oppMovesToGo = square_distance(pos.king_square(flip(c)), queeningSquare) - int(c != pos.side_to_move()); + oppMovesToGo = square_distance(pos.king_square(~c), queeningSquare) - int(c != pos.side_to_move()); pathDefended = ((ei.attackedBy[c][0] & queeningPath) == queeningPath); if (movesToGo >= oppMovesToGo && !pathDefended) @@ -928,7 +928,7 @@ namespace { return SCORE_ZERO; winnerSide = (pliesToQueen[WHITE] < pliesToQueen[BLACK] ? WHITE : BLACK); - loserSide = flip(winnerSide); + loserSide = ~winnerSide; // Step 3. Can the losing side possibly create a new passed pawn and thus prevent the loss? b = candidates = pos.pieces(PAWN, loserSide);