X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=69a756d9ce9b0b68ab0eecce7758a4ced1e05401;hp=dc0b51525981ba3656159c5255ebd06977ef5695;hb=e06a117d5e78ec4edc051f2b161d36559f784d37;hpb=d8f683760c9eb6d2c4714ec83e717dd2143de55c diff --git a/src/position.cpp b/src/position.cpp index dc0b5152..69a756d9 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -377,7 +377,7 @@ void Position::set_state(StateInfo* si) const { /// Position::set() is an overload to initialize the position object with -/// the given endgame code string like "KBPKN". It is manily an helper to +/// the given endgame code string like "KBPKN". It is mainly a helper to /// get the material key out of an endgame code. Position is not playable, /// indeed is even not guaranteed to be legal. @@ -595,7 +595,7 @@ bool Position::pseudo_legal(const Move m) const { && empty(to - pawn_push(us)))) return false; } - else if (!(attacks_from(pc, from) & to)) + else if (!(attacks_from(type_of(pc), from) & to)) return false; // Evasions generator already takes care to avoid some kind of illegal moves @@ -648,7 +648,7 @@ bool Position::gives_check(Move m) const { return false; case PROMOTION: - return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & square(~sideToMove); + return attacks_bb(promotion_type(m), to, pieces() ^ from) & square(~sideToMove); // En passant capture with check? We have already handled the case // of direct checks and ordinary discovered check, so the only case we @@ -827,7 +827,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { // Update pawn hash key and prefetch access to pawnsTable st->pawnKey ^= Zobrist::psq[pc][from] ^ Zobrist::psq[pc][to]; - prefetch(thisThread->pawnsTable[st->pawnKey]); + prefetch2(thisThread->pawnsTable[st->pawnKey]); // Reset rule 50 draw counter st->rule50 = 0;