mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-04 05:19:58 +03: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
Notes:
sideshowbarker
2024-07-18 17:43:36 +09:00
Author: https://github.com/josh-perry 🔰 Commit: https://github.com/SerenityOS/serenity/commit/c46ab4fbb92 Pull-request: https://github.com/SerenityOS/serenity/pull/7300
@ -199,7 +199,7 @@ String Move::to_algebraic() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_capture) {
|
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(from.to_algebraic().substring(0, 1));
|
||||||
builder.append("x");
|
builder.append("x");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user