mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
committed by
Marco Costalba
parent
3a572ffb48
commit
3d076a0c50
@@ -383,6 +383,12 @@ void Position::set_state(StateInfo* si) const {
|
|||||||
Square s = pop_lsb(&b);
|
Square s = pop_lsb(&b);
|
||||||
Piece pc = piece_on(s);
|
Piece pc = piece_on(s);
|
||||||
si->key ^= Zobrist::psq[pc][s];
|
si->key ^= Zobrist::psq[pc][s];
|
||||||
|
|
||||||
|
if (type_of(pc) == PAWN)
|
||||||
|
si->pawnKey ^= Zobrist::psq[pc][s];
|
||||||
|
|
||||||
|
else if (type_of(pc) != PAWN && type_of(pc) != KING)
|
||||||
|
si->nonPawnMaterial[color_of(pc)] += PieceValue[MG][pc];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (si->epSquare != SQ_NONE)
|
if (si->epSquare != SQ_NONE)
|
||||||
@@ -393,20 +399,9 @@ void Position::set_state(StateInfo* si) const {
|
|||||||
|
|
||||||
si->key ^= Zobrist::castling[si->castlingRights];
|
si->key ^= Zobrist::castling[si->castlingRights];
|
||||||
|
|
||||||
for (Bitboard b = pieces(PAWN); b; )
|
|
||||||
{
|
|
||||||
Square s = pop_lsb(&b);
|
|
||||||
si->pawnKey ^= Zobrist::psq[piece_on(s)][s];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Piece pc : Pieces)
|
for (Piece pc : Pieces)
|
||||||
{
|
|
||||||
if (type_of(pc) != PAWN && type_of(pc) != KING)
|
|
||||||
si->nonPawnMaterial[color_of(pc)] += pieceCount[pc] * PieceValue[MG][pc];
|
|
||||||
|
|
||||||
for (int cnt = 0; cnt < pieceCount[pc]; ++cnt)
|
for (int cnt = 0; cnt < pieceCount[pc]; ++cnt)
|
||||||
si->materialKey ^= Zobrist::psq[pc][cnt];
|
si->materialKey ^= Zobrist::psq[pc][cnt];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user