X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=839b44f5431087f1c191554c8cbd6720c5d57031;hb=c5e79d2e39fbafdeb7fac07906891d33b7a5363a;hp=39ec5357b901fdebd3e97150e56b007abd2075ee;hpb=f111a0eab598dd35c865985f85a93955f4fe5b3e;p=xboard.git diff --git a/backend.c b/backend.c index 39ec535..839b44f 100644 --- a/backend.c +++ b/backend.c @@ -5318,7 +5318,7 @@ Sweep (int step) if(gameInfo.variant == VariantSuicide || gameInfo.variant == VariantGiveaway) king = EmptySquare; if(promoSweep >= BlackPawn) king = WHITE_TO_BLACK king, pawn = WHITE_TO_BLACK pawn; if(gameInfo.variant == VariantSpartan && pawn == BlackPawn) pawn = BlackLance, king = EmptySquare; - if(fromY != BOARD_HEIGHT-2 && fromY != 1) pawn = EmptySquare; + if(fromY != BOARD_HEIGHT-2 && fromY != 1 && gameInfo.variant != VariantChuChess) pawn = EmptySquare; if(!step) toggleFlag = Partner(&last); // piece has shogi-promotion do { if(step && !(toggleFlag && Partner(&promoSweep))) promoSweep -= step; @@ -5328,7 +5328,9 @@ Sweep (int step) else if(promoSweep == WhiteKing && step > 0) promoSweep = BlackKing; if(!step) step = -1; } while(PieceToChar(promoSweep) == '.' || PieceToChar(promoSweep) == '~' || promoSweep == pawn || - appData.testLegality && (promoSweep == king || promoSweep == WhiteLion || promoSweep == BlackLion)); + !toggleFlag && PieceToChar(promoSweep) == '+' || // skip promoted versions of other + appData.testLegality && (promoSweep == king || gameInfo.variant != VariantChuChess && + (promoSweep == WhiteLion || promoSweep == BlackLion))); if(toX >= 0) { int victim = boards[currentMove][toY][toX]; boards[currentMove][toY][toX] = promoSweep; @@ -7173,12 +7175,15 @@ Mark (Board board, int flags, ChessMove kind, int rf, int ff, int rt, int ft, VO else if(flags & F_MANDATORY_CAPTURE && board[rt][ft] != EmptySquare) (*m)[rt][ft] = 3; } +static int hoverSavedValid; + void MarkTargetSquares (int clear) { int x, y, sum=0; if(clear) { // no reason to ever suppress clearing - for(x=0; x