1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:35:07 +00:00

Chess: On pgn import avoid losing piece promotion info

Fixes #13268
This commit is contained in:
Simon Danner 2022-03-26 17:04:48 +01:00 committed by Linus Groh
parent 1888e60015
commit 90fc28152b

View file

@ -165,7 +165,7 @@ Move Move::from_algebraic(StringView algebraic, const Color turn, const Board& b
} }
return IterationDecision::Continue; return IterationDecision::Continue;
} else { } else {
if (board.get_piece(square).type == move.piece.type && board.is_legal(Move(square, move.to), turn)) { if (board.get_piece(square).type == move.piece.type && board.is_legal(Move(square, move.to, move.promote_to), turn)) {
move.from = square; move.from = square;
return IterationDecision::Break; return IterationDecision::Break;
} }