src/game.c

changeset 110
e2bb03494d46
parent 104
0f69fe56a4cd
--- a/src/game.c	Mon Apr 20 22:01:38 2026 +0200
+++ b/src/game.c	Tue Apr 21 22:22:02 2026 +0200
@@ -82,14 +82,15 @@
     for (uint8_t y = 0 ; y < 8 ; y++) {
         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;
+            uint8_t piece = gamestate->board[y][x];
             char piecestr[5];
             if (piece) {
                 if (unicode) {
                     char* uc = getpieceunicode(piece);
                     strncpy(piecestr, uc, 5);
                 } else {
-                    piecestr[0] = piece == PAWN ? 'P' : getpiecechr(piece);
+                    piecestr[0] = (piece & PIECE_MASK) == PAWN
+                                      ? 'P' : getpiecechr(piece);
                     piecestr[1] = '\0';
                 }
             } else {

mercurial