mnm-sys / tezdhar

A fast and unbeatable chess engine written in C
GNU General Public License v3.0
3 stars 1 forks source link

Pawn promotion move not updating from/to square ranks and files #23

Closed mnm-sys closed 2 years ago

mnm-sys commented 2 years ago

Your move: fxe8=Q

move->movetext      = fxe8=Q
move->chessman          = Pawn
move->promoted          = Queen
move->from_file     = -
move->from_rank         = -
move->to_file           = -
move->to_rank           = -
move->castle_ks         = 0
move->castle_qs         = 0
move->null              = 0
move->invalid           = 0
move->draw_offered      = 0
move->ep                = 0
move->capture           = 0
move->check             = 0
move->checkmate         = 0

Notice here that move->[from|to]_[file|rank] fields are blank.

mnm-sys commented 2 years ago

The buggy part of the code has been identified. While checking if the move is of UCI format, the move text was getting stripped, and if the move was not of UCI format, the same stripped move text was being sent to the SAN parser. This issue was fixed by stripping a duplicate move text while checking for UCI format.