Generalize sittuyin promotion
authorFabian Fichter <ianfab@users.noreply.github.com>
Wed, 25 Dec 2019 11:33:00 +0000 (12:33 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 25 Dec 2019 11:33:00 +0000 (12:33 +0100)
No functional change.

src/movegen.cpp
src/variant.cpp

index e0b0377..119c205 100644 (file)
@@ -191,7 +191,7 @@ namespace {
             Square from = pop_lsb(&pawns);
             for (PieceType pt : pos.promotion_piece_types())
             {
-                if (pos.count(Us, pt))
+                if (pos.promotion_limit(pt) && pos.promotion_limit(pt) <= pos.count(Us, pt))
                     continue;
                 Bitboard b = (pos.attacks_from(Us, pt, from) & ~pos.pieces()) | from;
                 if (Type == EVASIONS)
index f02c826..1d9ce18 100644 (file)
@@ -296,6 +296,7 @@ namespace {
         v->sittuyinRookDrop = true;
         v->promotionRank = RANK_1; // no regular promotions
         v->sittuyinPromotion = true;
+        v->promotionLimit[FERS] = 1;
         v->immobilityIllegal = false;
         v->countingRule = ASEAN_COUNTING;
         v->nMoveRule = 50;