mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Fix in ok_to_history(): castle move is not a capture
It is erroneusly considered a capture because king moves on the same square of the rook. Use the correct function Position::move_is_capture() instead of the open coded (and buggy) one. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
d89a03cc35
commit
2d4e2bc62a
1 changed files with 2 additions and 4 deletions
|
@ -2155,13 +2155,11 @@ namespace {
|
|||
|
||||
|
||||
// ok_to_history() returns true if a move m can be stored
|
||||
// in history. Should be a non capturing move.
|
||||
// in history. Should be a non capturing move nor a promotion.
|
||||
|
||||
bool ok_to_history(const Position& pos, Move m) {
|
||||
|
||||
return pos.square_is_empty(move_to(m))
|
||||
&& !move_promotion(m)
|
||||
&& !move_is_ep(m);
|
||||
return !pos.move_is_capture(m) && !move_promotion(m);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue