Piece pc = dp.piece[i];
if (dp.from[i] != SQ_NONE)
removed.push_back(make_index(perspective, dp.from[i], pc, oriented_ksq, pos));
- else if (pos.piece_drops() && dp.dirty_num == 1)
+ else if (dp.handPiece[i] != NO_PIECE)
removed.push_back(make_index(perspective, dp.handCount[i], dp.handPiece[i], oriented_ksq, pos));
if (dp.to[i] != SQ_NONE)
added.push_back(make_index(perspective, dp.to[i], pc, oriented_ksq, pos));
- else if (pos.captures_to_hand() && i == 1)
+ else if (dp.handPiece[i] != NO_PIECE)
added.push_back(make_index(perspective, dp.handCount[i] - 1, dp.handPiece[i], oriented_ksq, pos));
}
}
dp.handCount[1] = pieceCountInHand[color_of(pieceToHand)][type_of(pieceToHand)];
}
}
- else
+ else if (Eval::useNNUE)
dp.handPiece[1] = NO_PIECE;
// Update material hash key and prefetch access to materialTable
{
// Promoting pawn to SQ_NONE, promoted piece from SQ_NONE
dp.to[0] = SQ_NONE;
+ dp.handPiece[0] = NO_PIECE;
dp.piece[dp.dirty_num] = promotion;
dp.handPiece[dp.dirty_num] = NO_PIECE;
dp.from[dp.dirty_num] = SQ_NONE;
{
// Promoting piece to SQ_NONE, promoted piece from SQ_NONE
dp.to[0] = SQ_NONE;
+ dp.handPiece[0] = NO_PIECE;
dp.piece[dp.dirty_num] = promotion;
dp.handPiece[dp.dirty_num] = NO_PIECE;
dp.from[dp.dirty_num] = SQ_NONE;
{
// Demoting piece to SQ_NONE, demoted piece from SQ_NONE
dp.to[0] = SQ_NONE;
+ dp.handPiece[0] = NO_PIECE;
dp.piece[dp.dirty_num] = demotion;
dp.handPiece[dp.dirty_num] = NO_PIECE;
dp.from[dp.dirty_num] = SQ_NONE;