Fix zippy handling of draw offers from ICS
[xboard.git] / moves.c
diff --git a/moves.c b/moves.c
index af04d1e..7267173 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -144,6 +144,7 @@ char pieceToChar[] = {
                         'p', 'n', 'b', 'r', 'q', 'f', 'e', 'a', 'c', 'w', 'm', 
                         'o', 'h', 'i', 'j', 'g', 'd', 'v', 'l', 's', 'u', 'k', 
                         'x' };
+char pieceNickName[EmptySquare];
 
 char PieceToChar(p)
      ChessSquare p;
@@ -167,6 +168,8 @@ ChessSquare CharToPiece(c)
 {
      int i;
      for(i=0; i< (int) EmptySquare; i++)
+          if(pieceNickName[i] == c) return (ChessSquare) i;
+     for(i=0; i< (int) EmptySquare; i++)
           if(pieceToChar[i] == c) return (ChessSquare) i;
      return EmptySquare;
 }
@@ -1284,7 +1287,7 @@ void Disambiguate(board, flags, closure)
                              closure->kind = c == '=' ? IllegalMove : WhitePromotionKnight;
                     else /* promotion optional, default is promote */
                              closure->kind = c == '=' ? NormalMove  : WhitePromotionQueen;
-                   
+                    if(c != '=') closure->promoCharIn = 'q';
                 } else closure->kind = (c == NULLCHAR || c == 'x' || c == '=') ?
                                             NormalMove : IllegalMove;
             } else {
@@ -1294,7 +1297,7 @@ void Disambiguate(board, flags, closure)
                              closure->kind = c == '=' ? IllegalMove : BlackPromotionKnight;
                     else /* promotion optional, default is promote */
                              closure->kind = c == '=' ? NormalMove  : BlackPromotionQueen;
-
+                    if(c != '=') closure->promoCharIn = 'q';
                 } else closure->kind = (c == NULLCHAR || c == 'x' || c == '=') ?
                                             NormalMove : IllegalMove;
             }