src/chess/rook.c

changeset 195
27d02ccb0cef
parent 194
619f07c95894
--- a/src/chess/rook.c	Tue Aug 25 18:59:18 2026 +0200
+++ b/src/chess/rook.c	Tue Aug 25 19:42:15 2026 +0200
@@ -60,7 +60,7 @@
 }
 
 size_t rook_moves(const GameState *gamestate,
-        Color c, Rank r, File f, Move *moves) {
+        Color c, File f, Rank r, Move *moves) {
     size_t count = 0;
     const int directions[4][2] = {
         { 1,  0},
@@ -80,7 +80,7 @@
             moves[count].fromfile = f;
             moves[count].torank = rank;
             moves[count].tofile = file;
-            moves[count].capture = piece_at(gamestate, rank, file) != 0;
+            moves[count].capture = piece_at(gamestate, file, rank) != 0;
             count++;
 
             rank += directions[i][0];

mercurial