Change default sweep-promotion choicein queenless variants
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 4 Nov 2011 20:48:24 +0000 (21:48 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 4 Nov 2011 20:48:24 +0000 (21:48 +0100)
The initial scanning of the sweep piece until a defined piece is found
is now in the increasing direction (still starting at Queen), so that
the fairy pieces are suggested before R, B and N.

backend.c

index 8d16cf5..2f71b5e 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -5136,7 +5136,7 @@ Sweep(int step)
        else if((int)promoSweep == -1) promoSweep = WhiteKing;
        else if(promoSweep == BlackPawn && step < 0) promoSweep = WhitePawn;
        else if(promoSweep == WhiteKing && step > 0) promoSweep = BlackKing;
-       if(!step) step = 1;
+       if(!step) step = -1;
     } while(PieceToChar(promoSweep) == '.' || PieceToChar(promoSweep) == '~' || promoSweep == pawn ||
            appData.testLegality && (promoSweep == king ||
            gameInfo.variant == VariantShogi && promoSweep != PROMOTED last && last != PROMOTED promoSweep && last != promoSweep));