online multiplayer chess game (note server currently down)
fix pgn being off by one sometimes
bendn 2022-07-07
parent d5bb0ae · commit 666a836
-rw-r--r--board/chess.gd3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/chess.gd b/board/chess.gd
index 06f3822..4257908 100644
--- a/board/chess.gd
+++ b/board/chess.gd
@@ -1057,6 +1057,9 @@ func pgn() -> String:
move_string += " %s" % __move_to_san(move, __generate_moves({legal = true}))
__make_move(move)
+
+ if move_string.length():
+ moves.append(move_string)
# __history should be back to what it was before we started generating PGN,
# so join together moves