--- a/src/main.c Mon Aug 24 13:20:19 2026 +0200 +++ b/src/main.c Mon Aug 24 13:42:35 2026 +0200 @@ -478,6 +478,7 @@ if (result == VALID_MOVE_SYNTAX) { result = validate_move(gamestate, &move); if (result == VALID_MOVE_SEMANTICS) { + format_move(gamestate, &move); apply_move(gamestate, &move); if (is_game_running(gamestate)) { return 0; @@ -496,13 +497,13 @@ } } -#define NETMOVE_LEN 14 +#define NETMOVE_LEN 16 #define NETGI_LEN 8 static NetGameInfo hton_gi(GameInfo gi) { return (NetGameInfo) { .servercolor = gi.servercolor, - .timecontrol = gi.timecontrol ? 1 : 0, + .timecontrol = gi.timecontrol, .time = net_htons(gi.time), .addtime = net_htons(gi.addtime), .delay = net_htons(gi.delay) @@ -526,7 +527,9 @@ .piece = move.piece, .fromfile = move.fromfile, .fromrow = move.fromrow, .tofile = move.tofile, .torow = move.torow, - .promotion = move.promotion + .capture = move.capture, + .check_or_mate = move.checkmate + move.check, + .promotion = move.promotion, }; } @@ -540,8 +543,9 @@ .fromfile = move.fromfile, .fromrow = move.fromrow, .tofile = move.tofile, .torow = move.torow, .promotion = move.promotion, - /* flags are also calculated before applying the move */ - 0 + .check = move.check_or_mate, + .checkmate = move.check_or_mate >> 1, + .capture = move.capture }; } @@ -676,6 +680,7 @@ || code == NETCODE_CHECKMATE || code == NETCODE_STALEMATE || code == NETCODE_NOMATERIAL) { + format_move(gamestate, &move); apply_move(gamestate, &move); if (is_game_running(gamestate)) { return 0; @@ -812,9 +817,9 @@ NetMove nmove; net_recieve_data(opponent, &nmove, NETMOVE_LEN); Move move = ntoh_move(nmove); - format_move(gamestate, &move); code = validate_move(gamestate, &move); if (code == VALID_MOVE_SEMANTICS) { + format_move(gamestate, &move); apply_move(gamestate, &move); if (gamestate->checkmate) { net_send_code(opponent, NETCODE_CHECKMATE);