handle promotion case for Shogi
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 8 May 2009 04:44:03 +0000 (21:44 -0700)
committerArun Persaud <arun@nubati.net>
Fri, 8 May 2009 04:44:03 +0000 (21:44 -0700)
moves.c

diff --git a/moves.c b/moves.c
index 58cbfc0..eb0701c 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -169,7 +169,9 @@ ChessMove PromoCharToMoveType(whiteOnMove, promoChar)
      int whiteOnMove;\r
      int promoChar;\r
 {      /* [HGM] made dependent on CharToPiece to alow alternate piece letters */\r
-       ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) );
+       ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) );\r
+\r
+
        if(promoChar == NULLCHAR) return NormalMove;\r
 \r
        switch(piece) {\r
@@ -1086,6 +1088,7 @@ ChessMove LegalityTest(board, flags, epfile, castlingRights, rf, ff, rt, ft, pro
         }\r
     } else\r
     if (promoChar != NULLCHAR && promoChar != 'x') {\r
+       if(promoChar == '=') cl.kind = IllegalMove; else // [HGM] shogi: no deferred promotion outside Shogi\r
        if (cl.kind == WhitePromotionQueen || cl.kind == BlackPromotionQueen) {\r
            cl.kind = \r
              PromoCharToMoveType((flags & F_WHITE_ON_MOVE) != 0, promoChar);\r