--- a/src/chess/fen.c Fri Sep 04 13:49:48 2026 +0200 +++ b/src/chess/fen.c Sat Sep 05 12:36:04 2026 +0200 @@ -108,8 +108,7 @@ } static size_t fen_halfmove(char *str, const GameState *gamestate) { - // TODO: respect a possible fifty_ctr_start - unsigned int hm = 0; + unsigned int hm = gamestate->fifty_cntr_start; for (unsigned int i = 0; i < gamestate->movecount; i++) { if (gamestate->moves[i].capture || piece_type(gamestate->moves[i].piece) == PAWN) { @@ -123,8 +122,7 @@ } static size_t fen_movenr(char *str, const GameState *gamestate) { - unsigned mc = gamestate->movecount + gamestate->move_start; - return sprintf(str, "%u", 1 + mc / 2); + return sprintf(str, "%u", move_number(gamestate)); } static size_t fen_space(char *str) {