[position] Pop captured piece from CapturesList on unmake
This commit is contained in:
parent
c476e93f33
commit
c70cefc848
2 changed files with 10 additions and 1 deletions
|
@ -189,7 +189,12 @@ impl Position {
|
|||
|
||||
let unmake_result = self.board.unmake_move(&last_move_record);
|
||||
|
||||
if unmake_result.is_err() {
|
||||
if unmake_result.is_ok() {
|
||||
if let Some(capture) = last_move_record.captured_piece {
|
||||
let popped_piece = self.captures.pop(last_move_record.color);
|
||||
debug_assert_eq!(Some(capture), popped_piece);
|
||||
}
|
||||
} else {
|
||||
self.moves.push(last_move_record);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue