src/chess/fen.c

changeset 195
27d02ccb0cef
parent 194
619f07c95894
--- a/src/chess/fen.c	Tue Aug 25 18:59:18 2026 +0200
+++ b/src/chess/fen.c	Tue Aug 25 19:42:15 2026 +0200
@@ -43,7 +43,7 @@
                     str[i++] = '0'+skip;
                     skip = 0;
                 }
-                switch (piece_at(gamestate, rank, file)) {
+                switch (piece_at(gamestate, file, rank)) {
                 case WHITE|KING: str[i++] = 'K'; break;
                 case WHITE|QUEEN: str[i++] = 'Q'; break;
                 case WHITE|BISHOP: str[i++] = 'B'; break;
@@ -121,11 +121,11 @@
     str[0] = '-';
 
     for (int file = 0 ; file < 8 ; file++) {
-        if (enpassant_threat_exists(gamestate, 3, file)) {
+        if (enpassant_threat_exists(gamestate, file, 3)) {
             str[0] = filechr(file);
             str[1] = rankchr(2);
         }
-        if (enpassant_threat_exists(gamestate, 4, file)) {
+        if (enpassant_threat_exists(gamestate, file, 4)) {
             str[0] = filechr(file);
             str[1] = rankchr(5);
         }

mercurial