src/game.c

changeset 87
d4d67105d4e1
parent 83
ead00609e5e6
--- a/src/game.c	Sun Nov 30 22:42:46 2025 +0100
+++ b/src/game.c	Fri Mar 27 18:11:42 2026 +0100
@@ -84,10 +84,10 @@
         for (uint8_t x = 0 ; x < 8 ; x++) {
             uint8_t col = gamestate->board[y][x] & COLOR_MASK;
             uint8_t piece = gamestate->board[y][x] & PIECE_MASK;
-            unsigned char piecestr[5];
+            char piecestr[5];
             if (piece) {
                 if (unicode) {
-                    unsigned char* uc = getpieceunicode(piece);
+                    char* uc = getpieceunicode(piece);
                     strncpy(piecestr, uc, 5);
                 } else {
                     piecestr[0] = piece == PAWN ? 'P' : getpiecechr(piece);
@@ -395,9 +395,9 @@
         FD_ZERO(&readfds);
         FD_SET(opponent, &readfds);
         timeout.tv_sec = 0;
-        timeout.tv_usec = 1e5;
+        timeout.tv_usec = 100000;
         
-        // TODO: allow commands
+        // TODO: allow commands while waiting (e.g. resign, offer draw)
         
         int result = select(opponent+1, &readfds, NULL, NULL, &timeout);
         if (result == -1) {

mercurial