Sat, 01 Aug 2026 10:58:39 +0200
fix regression: missing promotion when simulating threats
| src/chess/rules.c | file | annotate | diff | comparison | revisions |
--- 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++; } }