@@ -360,7 +360,7 @@ void Position::set_state() const {
360360 {
361361 st->nonPawnMaterial [color_of (pc)] += PieceValue[pc];
362362
363- if (type_of (pc) == QUEEN || type_of (pc) = = ROOK)
363+ if (type_of (pc) > = ROOK)
364364 st->majorPieceKey ^= Zobrist::psq[pc][s];
365365
366366 else
@@ -759,7 +759,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
759759 st->nonPawnMaterial [them] -= PieceValue[captured];
760760 st->nonPawnKey [them] ^= Zobrist::psq[captured][capsq];
761761
762- if (type_of (captured) == QUEEN || type_of (captured) = = ROOK)
762+ if (type_of (captured) > = ROOK)
763763 st->majorPieceKey ^= Zobrist::psq[captured][capsq];
764764
765765 else
@@ -844,7 +844,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
844844 st->materialKey ^=
845845 Zobrist::psq[promotion][pieceCount[promotion] - 1 ] ^ Zobrist::psq[pc][pieceCount[pc]];
846846
847- if (promotionType == QUEEN || promotionType = = ROOK)
847+ if (promotionType > = ROOK)
848848 st->majorPieceKey ^= Zobrist::psq[promotion][to];
849849
850850 else
@@ -871,7 +871,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
871871 st->minorPieceKey ^= Zobrist::psq[pc][from] ^ Zobrist::psq[pc][to];
872872 }
873873
874- else if (type_of (pc) == QUEEN || type_of (pc) = = ROOK)
874+ else if (type_of (pc) > = ROOK)
875875 st->majorPieceKey ^= Zobrist::psq[pc][from] ^ Zobrist::psq[pc][to];
876876
877877 else
0 commit comments