src/chess/rules.c

changeset 165
3e27c99ed721
parent 164
c19d8523b31c
child 166
1a9b662bc201
--- a/src/chess/rules.c	Sat Aug 01 10:53:44 2026 +0200
+++ b/src/chess/rules.c	Sat Aug 01 10:58:39 2026 +0200
@@ -695,6 +695,10 @@
                 candidates[ccount].torow = row;
                 candidates[ccount].tofile = file;
                 candidates[ccount].capture = true;
+                if (piece_type(p) == PAWN && (row == 0 || row == 7)) {
+                    /* the exact piece for promotion does not matter */
+                    candidates[ccount].promotion = mkpiece(QUEEN, color);
+                }
                 ccount++;
             }
         }

mercurial