mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
parent
3a572ffb48
commit
3d076a0c50
1 changed files with 6 additions and 11 deletions
|
@ -383,6 +383,12 @@ void Position::set_state(StateInfo* si) const {
|
|||
Square s = pop_lsb(&b);
|
||||
Piece pc = piece_on(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)
|
||||
|
@ -393,20 +399,9 @@ void Position::set_state(StateInfo* si) const {
|
|||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
si->materialKey ^= Zobrist::psq[pc][cnt];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue