From: H.G. Muller Date: Fri, 8 May 2009 04:44:03 +0000 (-0700) Subject: handle promotion case for Shogi X-Git-Tag: v4.4.0.alpha2~5 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0572e7f6b4745cdfc793faa3af6c19ddb750c4ba;p=xboard.git handle promotion case for Shogi --- diff --git a/moves.c b/moves.c index 58cbfc0..eb0701c 100644 --- a/moves.c +++ b/moves.c @@ -169,7 +169,9 @@ ChessMove PromoCharToMoveType(whiteOnMove, promoChar) int whiteOnMove; int promoChar; { /* [HGM] made dependent on CharToPiece to alow alternate piece letters */ - ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) ); + ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) ); + + if(promoChar == NULLCHAR) return NormalMove; switch(piece) { @@ -1086,6 +1088,7 @@ ChessMove LegalityTest(board, flags, epfile, castlingRights, rf, ff, rt, ft, pro } } else if (promoChar != NULLCHAR && promoChar != 'x') { + if(promoChar == '=') cl.kind = IllegalMove; else // [HGM] shogi: no deferred promotion outside Shogi if (cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen) { cl.kind = PromoCharToMoveType((flags & F_WHITE_ON_MOVE) != 0, promoChar);