mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibChess: Fixed PGN export bug (#7300)
In cases with ambiguous captures involving pawns (where multiple pieces could have made the capture), we were exporting invalid syntax for the move: `1. e4 e5 2. Bb5 c6 3. Bxc6 ddxc6` Move 3 should be `Bxc6 dxc6`, but we were duplicating the d on the pawn move.
This commit is contained in:
parent
4a2dd5bf66
commit
c46ab4fbb9
1 changed files with 1 additions and 1 deletions
|
@ -199,7 +199,7 @@ String Move::to_algebraic() const
|
|||
}
|
||||
|
||||
if (is_capture) {
|
||||
if (piece.type == Type::Pawn)
|
||||
if (piece.type == Type::Pawn && !is_ambiguous)
|
||||
builder.append(from.to_algebraic().substring(0, 1));
|
||||
builder.append("x");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue