changes from H.G. Muller; version 4.3.16
[xboard.git] / moves.c
diff --git a/moves.c b/moves.c
index 0def075..58cbfc0 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -169,7 +169,8 @@ 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) );\r
+       ChessSquare piece = CharToPiece(whiteOnMove ? ToUpper(promoChar) : ToLower(promoChar) );
+       if(promoChar == NULLCHAR) return NormalMove;\r
 \r
        switch(piece) {\r
                case WhiteQueen:\r
@@ -577,7 +578,7 @@ void GenPseudoLegal(board, flags, epfile, callback, closure)
                      if (board[rt][ft] != EmptySquare) break;\r
                  }\r
                 if(m==1) goto mounted;\r
-                if(m==2) goto walking;\r
+                if(m==2) goto finishGold;\r
              break;\r
 \r
            case WhiteQueen:\r
@@ -1265,7 +1266,7 @@ void Disambiguate(board, flags, epfile, closure)
 #endif\r
     /* [HGM] returns 'q' for optional promotion, 'n' for mandatory */\r
     if(closure->promoCharIn != '=')\r
-        closure->promoChar = ToLower(PieceToChar(PromoPiece(closure->kind)));\r
+        closure->promoChar = ToLower(closure->promoCharIn);\r
     else closure->promoChar = '=';\r
     if (closure->promoChar == 'x') closure->promoChar = NULLCHAR;\r
     if (closure->count > 1) {\r
@@ -1280,7 +1281,7 @@ void Disambiguate(board, flags, epfile, closure)
     }\r
     if(closure->kind == IllegalMove)\r
     /* [HGM] might be a variant we don't understand, pass on promotion info */\r
-        closure->promoChar = closure->promoCharIn;\r
+        closure->promoChar = ToLower(closure->promoCharIn);\r
     if (appData.debugMode) {\r
         fprintf(debugFP, "Disambiguate out: %d(%d,%d)-(%d,%d) = %d (%c)\n",\r
         closure->piece,closure->ff,closure->rf,closure->ft,closure->rt,closure->promoChar,\r