From faf83d9ada6e3cdfee3f02dbe5140332924ac61f Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 8 Jan 2014 16:25:25 +0100 Subject: [PATCH] Fix Chu promotion of L, HM and GB The promotion popup would not be shown for HM and GB with legality testing on because the piece types used for them were wild-card pieces. The Lance was treated as a Pawn in HasPrmotionChoice(). --- backend.c | 4 ++-- moves.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend.c b/backend.c index 084c42c..ab8d1d5 100644 --- a/backend.c +++ b/backend.c @@ -6520,8 +6520,8 @@ HasPromotionChoice (int fromX, int fromY, int toX, int toY, char *promoChoice, i promotionZoneSize = 3; } - // Treat Lance as Pawn when it is not representing Amazon - if(gameInfo.variant != VariantSuper) { + // Treat Lance as Pawn when it is not representing Amazon or Lance + if(gameInfo.variant != VariantSuper && gameInfo.variant != VariantChu) { if(piece == WhiteLance) piece = WhitePawn; else if(piece == BlackLance) piece = BlackPawn; } diff --git a/moves.c b/moves.c index 7ffe59d..e20d2e4 100644 --- a/moves.c +++ b/moves.c @@ -1456,8 +1456,8 @@ LegalityTest (Board board, int flags, int rf, int ff, int rt, int ft, int promoC /* [HGM] Cobra and Falcon are wildcard pieces; consider all their moves legal */ /* (perhaps we should disallow moves that obviously leave us in check?) */ - if(piece == WhiteFalcon || piece == BlackFalcon || - piece == WhiteCobra || piece == BlackCobra) + if((piece == WhiteFalcon || piece == BlackFalcon || + piece == WhiteCobra || piece == BlackCobra) && gameInfo.variant != VariantChu) return CheckTest(board, flags, rf, ff, rt, ft, FALSE) ? IllegalMove : NormalMove; cl.rf = rf; -- 1.7.0.4