Fix spurious promo-suffixes on drop moves
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 20 Feb 2015 19:27:45 +0000 (20:27 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 7 May 2015 18:53:33 +0000 (20:53 +0200)
The promo-suffix from the previous move would be left on drop moves,
and could even be set to the engine.

parser.c

index c5b79fa..d60b833 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -267,6 +267,7 @@ NextUnit (char **p)
                fromY = DROP_RANK; fromX = cl.pieceIn;
                currentMoveString[0] = piece;
                currentMoveString[1] = '@';
+               currentMoveString[4] = NULLCHAR;
                return LegalityTest(boards[yyboardindex], PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, fromY, fromX, toY, toX, NULLCHAR);
            }
            if(type[1] == NOTHING && type[0] != NOTHING) { // there is a disambiguator