浏览代码

Chess: On pgn import avoid losing piece promotion info

Fixes #13268
Simon Danner 3 年之前
父节点
当前提交
90fc28152b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibChess/Chess.cpp

+ 1 - 1
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;
             }