Skip to content

Commit 05cd510

Browse files
committed
Fix shadow warning in points capture helper
1 parent edd1e7c commit 05cd510

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/position.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,13 +1647,13 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
16471647
if (oldClamped != newClamped)
16481648
k ^= Zobrist::points[scorer][oldClamped] ^ Zobrist::points[scorer][newClamped];
16491649
};
1650-
auto scored_capture_piece = [&](Piece pc, Square sq) {
1650+
auto scored_capture_piece = [&](Piece capturedPiece, Square sq) {
16511651
if (!captures_to_hand() || drop_loop() || !is_promoted(sq))
1652-
return pc;
1652+
return capturedPiece;
16531653
Piece unpromotedCaptured = unpromoted_piece_on(sq);
16541654
return unpromotedCaptured != NO_PIECE
16551655
? unpromotedCaptured
1656-
: make_piece(color_of(pc), main_promotion_pawn_type(color_of(pc)));
1656+
: make_piece(color_of(capturedPiece), main_promotion_pawn_type(color_of(capturedPiece)));
16571657
};
16581658

16591659
if (check_counting() && givesCheck)

0 commit comments

Comments
 (0)