# HG changeset patch # User Mike Becker # Date 1785574719 -7200 # Node ID 3e27c99ed721c513b6000ce1798c3d9632680073 # Parent c19d8523b31c3c4030617408f33035b0efd38e69 fix regression: missing promotion when simulating threats diff -r c19d8523b31c -r 3e27c99ed721 src/chess/rules.c --- 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++; } }