Fix null move issue

Fix altering for stats landing on B1 Square after a null move and fix considering counter-moves on A1 for root node.

fixes https://github.com/official-stockfish/Stockfish/issues/4333 by preventing calls to from_sq and to_sq functions over null-moves and none-moves.

closes https://github.com/official-stockfish/Stockfish/pull/4448

bench: 4980082
This commit is contained in:
peregrineshahin
2023-03-12 01:22:55 +03:00
committed by Joost VandeVondele
parent f0556dcbe3
commit 515b66f188
3 changed files with 21 additions and 14 deletions

View File

@@ -358,15 +358,15 @@ std::string UCI::square(Square s) {
string UCI::move(Move m, bool chess960) {
Square from = from_sq(m);
Square to = to_sq(m);
if (m == MOVE_NONE)
return "(none)";
if (m == MOVE_NULL)
return "0000";
Square from = from_sq(m);
Square to = to_sq(m);
if (type_of(m) == CASTLING && !chess960)
to = make_square(to > from ? FILE_G : FILE_C, rank_of(from));