Use normal SAN for wildcard pieces
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 6 Nov 2010 18:34:53 +0000 (19:34 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Tue, 9 Nov 2010 14:01:32 +0000 (15:01 +0100)
SAN often can also be used with pieces we don't know the moves of, e.g.
if there is only one of that type. We just always get rank or file
disambiguators if there are more (even when they might be unnecessary).

moves.c

diff --git a/moves.c b/moves.c
index 830e0bb..5634b43 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -1337,7 +1337,7 @@ void CoordsToAlgebraicCallback(board, flags, kind, rf, ff, rt, ft, closure)
     register CoordsToAlgebraicClosure *cl =
       (CoordsToAlgebraicClosure *) closure;
 
     register CoordsToAlgebraicClosure *cl =
       (CoordsToAlgebraicClosure *) closure;
 
-    if (rt == cl->rt && ft == cl->ft &&
+    if ((rt == cl->rt && ft == cl->ft || rt == rf && ft == ff) && // [HGM] null move matches any toSquare
         (board[rf][ff] == cl->piece
          || PieceToChar(board[rf][ff]) == '~' &&
             (ChessSquare) (DEMOTED board[rf][ff]) == cl->piece)
         (board[rf][ff] == cl->piece
          || PieceToChar(board[rf][ff]) == '~' &&
             (ChessSquare) (DEMOTED board[rf][ff]) == cl->piece)
@@ -1527,14 +1527,7 @@ ChessMove CoordsToAlgebraic(board, flags, rf, ff, rt, ft, promoChar, out)
         }
        *outp = NULLCHAR;
         return cl.kind;
         }
        *outp = NULLCHAR;
         return cl.kind;
-
-      /* [HGM] Always long notation for fairies we don't know */
-      case WhiteFalcon:
-      case BlackFalcon:
-      case WhiteLance:
-      case BlackLance:
-      case WhiteGrasshopper:
-      case BlackGrasshopper:
+       
       case EmptySquare:
        /* Moving a nonexistent piece */
        break;
       case EmptySquare:
        /* Moving a nonexistent piece */
        break;