From: H.G.Muller Date: Tue, 29 Mar 2016 18:20:54 +0000 (+0200) Subject: Fix disambiguation for one-click moving X-Git-Url: http://hgm.nubati.net/cgi-bin/gitweb.cgi?p=xboard.git;a=commitdiff_plain;h=2d18618a1697830a12fbdcaa398bb8bde18558fe;ds=sidebyside Fix disambiguation for one-click moving The test in the DisambiguateCallback to ignore duplicate moves (as sometimes generated by Betza descriptions) was only testing for the same from square. This is good enugh if the to-square is always given (as in SAN), so that moves with different to-square would always be rejected anyway. But to determine if a piece has only a single move we disambiguate with unknown to-square. So all moves but the first of a piece would be ignored, making it always pass the only-move test. We now test both from- and to-square, and only ignore moves that have both of these equal to that of an already matching move. --- diff --git a/moves.c b/moves.c index c8f8039a..abf19360 100644 --- a/moves.c +++ b/moves.c @@ -2058,7 +2058,7 @@ DisambiguateCallback (Board board, int flags, ChessMove kind, int rf, int ff, in (cl->rtIn == -1 || cl->rtIn == rt || wildCard) && (cl->ftIn == -1 || cl->ftIn == ft || wildCard)) { - if(cl->count && rf == cl->rf && ff == cl->ff) return; // duplicate move + if(cl->count && rf == cl->rf && ff == cl->ff && rt == cl->rt && ft == cl->ft) return; // duplicate move if(cl->count == 1 && kifu & 0x7E && cl->rfIn == -1 && cl->ffIn == -1) { // traditional Shogi disambiguation required int this = 1, other = 1;