From 334788d6e5b3400f7c4d42968f48f22f7178d609 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 6 Nov 2010 19:34:53 +0100 Subject: [PATCH] Use normal SAN for wildcard pieces 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 | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/moves.c b/moves.c index 830e0bb..5634b43 100644 --- 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; - 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) @@ -1527,14 +1527,7 @@ ChessMove CoordsToAlgebraic(board, flags, rf, ff, rt, ft, promoChar, out) } *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; -- 1.7.0.4