@@ -360,7 +360,7 @@ void Position::set_state() const {
360
360
{
361
361
st->nonPawnMaterial [color_of (pc)] += PieceValue[pc];
362
362
363
- if (type_of (pc) == QUEEN || type_of (pc) = = ROOK)
363
+ if (type_of (pc) > = ROOK)
364
364
st->majorPieceKey ^= Zobrist::psq[pc][s];
365
365
366
366
else
@@ -759,7 +759,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
759
759
st->nonPawnMaterial [them] -= PieceValue[captured];
760
760
st->nonPawnKey [them] ^= Zobrist::psq[captured][capsq];
761
761
762
- if (type_of (captured) == QUEEN || type_of (captured) = = ROOK)
762
+ if (type_of (captured) > = ROOK)
763
763
st->majorPieceKey ^= Zobrist::psq[captured][capsq];
764
764
765
765
else
@@ -844,7 +844,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
844
844
st->materialKey ^=
845
845
Zobrist::psq[promotion][pieceCount[promotion] - 1 ] ^ Zobrist::psq[pc][pieceCount[pc]];
846
846
847
- if (promotionType == QUEEN || promotionType = = ROOK)
847
+ if (promotionType > = ROOK)
848
848
st->majorPieceKey ^= Zobrist::psq[promotion][to];
849
849
850
850
else
@@ -871,7 +871,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
871
871
st->minorPieceKey ^= Zobrist::psq[pc][from] ^ Zobrist::psq[pc][to];
872
872
}
873
873
874
- else if (type_of (pc) == QUEEN || type_of (pc) = = ROOK)
874
+ else if (type_of (pc) > = ROOK)
875
875
st->majorPieceKey ^= Zobrist::psq[pc][from] ^ Zobrist::psq[pc][to];
876
876
877
877
else
0 commit comments