+/// Position::do_capture_move() is a private method used to update captured
+/// piece info. It is called from the main Position::do_move function.
+
+void Position::do_capture_move(Move m, PieceType capture, Color them, Square to) {
+
+ assert(capture != KING);
+
+ // Remove captured piece
+ clear_bit(&(byColorBB[them]), to);
+ clear_bit(&(byTypeBB[capture]), to);
+
+ // Update hash key
+ key ^= zobrist[them][capture][to];
+
+ // If the captured piece was a pawn, update pawn hash key
+ if (capture == PAWN)
+ pawnKey ^= zobrist[them][PAWN][to];
+
+ // Update incremental scores
+ mgValue -= mg_pst(them, capture, to);
+ egValue -= eg_pst(them, capture, to);
+
+ assert(!move_promotion(m) || capture != PAWN);
+
+ // Update material
+ if (capture != PAWN)
+ npMaterial[them] -= piece_value_midgame(capture);
+
+ // Update material hash key
+ materialKey ^= zobMaterial[them][capture][pieceCount[them][capture]];
+
+ // Update piece count
+ pieceCount[them][capture]--;
+
+ // Update piece list
+ pieceList[them][capture][index[to]] = pieceList[them][capture][pieceCount[them][capture]];
+ index[pieceList[them][capture][index[to]]] = index[to];
+
+ // Reset rule 50 counter
+ rule50 = 0;
+}
+
+