From: H.G. Muller Date: Sat, 6 Nov 2010 18:34:53 +0000 (+0100) Subject: Use normal SAN for wildcard pieces X-Git-Url: http://hgm.nubati.net/cgi-bin/gitweb.cgi?p=xboard.git;a=commitdiff_plain;h=334788d6e5b3400f7c4d42968f48f22f7178d609;ds=sidebyside 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). --- diff --git a/moves.c b/moves.c index 830e0bbd..5634b430 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;