File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ void Position::set_state() const {
388
388
389
389
for (Piece pc : Pieces)
390
390
for (int cnt = 0 ; cnt < pieceCount[pc]; ++cnt)
391
- st->materialKey ^= Zobrist::psq[pc][cnt];
391
+ st->materialKey ^= Zobrist::psq[pc][8 + cnt];
392
392
}
393
393
394
394
@@ -792,7 +792,7 @@ void Position::do_move(Move m,
792
792
remove_piece (capsq);
793
793
794
794
k ^= Zobrist::psq[captured][capsq];
795
- st->materialKey ^= Zobrist::psq[captured][pieceCount[captured]];
795
+ st->materialKey ^= Zobrist::psq[captured][8 + pieceCount[captured]];
796
796
797
797
// Reset rule 50 counter
798
798
st->rule50 = 0 ;
@@ -859,7 +859,7 @@ void Position::do_move(Move m,
859
859
// Zobrist::psq[pc][to] is zero, so we don't need to clear it
860
860
k ^= Zobrist::psq[promotion][to];
861
861
st->materialKey ^=
862
- Zobrist::psq[promotion][pieceCount[promotion] - 1 ] ^ Zobrist::psq[pc][pieceCount[pc]];
862
+ Zobrist::psq[promotion][8 + pieceCount[promotion] - 1 ] ^ Zobrist::psq[pc][8 + pieceCount[pc]];
863
863
864
864
if (promotionType >= ROOK)
865
865
st->majorPieceKey ^= Zobrist::psq[promotion][to];
You can’t perform that action at this time.
0 commit comments