summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibChess
diff options
context:
space:
mode:
authorSimon Danner <danner.simon@gmail.com>2022-03-26 17:04:48 +0100
committerLinus Groh <mail@linusgroh.de>2022-03-26 18:30:12 +0000
commit90fc28152bde11fa96a98b9cced21dc2678fd62c (patch)
treea760c1fdc5a77e1ee575d61ba670439c0f889467 /Userland/Libraries/LibChess
parent1888e600159bc968189e11f01437fb0155642d9d (diff)
downloadserenity-90fc28152bde11fa96a98b9cced21dc2678fd62c.zip
Chess: On pgn import avoid losing piece promotion info
Fixes #13268
Diffstat (limited to 'Userland/Libraries/LibChess')
-rw-r--r--Userland/Libraries/LibChess/Chess.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp
index e50ec108fc..6d56ecd1f0 100644
--- a/Userland/Libraries/LibChess/Chess.cpp
+++ b/Userland/Libraries/LibChess/Chess.cpp
@@ -165,7 +165,7 @@ Move Move::from_algebraic(StringView algebraic, const Color turn, const Board& b
}
return IterationDecision::Continue;
} 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;
return IterationDecision::Break;
}