From: H.G.Muller Date: Sun, 17 Apr 2016 07:32:40 +0000 (+0200) Subject: Fix one-click moving with engine-define and wild-card pieces X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7f8decab1cc394f7a798b04fc0a3de4edf043877;p=xboard.git Fix one-click moving with engine-define and wild-card pieces In the disambiguation routine wild-card pieces were still treated as special even when explicit moves were defined for them. In addition, Disambiguate would try native XBoard piece motion for resolving ambiguous moves, which is sensible for parsing SAN (which might be saved by an old version of XBoard), but wrecks one-click moving. --- diff --git a/moves.c b/moves.c index 3205d2f..cc3343b 100644 --- a/moves.c +++ b/moves.c @@ -2047,7 +2047,7 @@ DisambiguateCallback (Board board, int flags, ChessMove kind, int rf, int ff, in // [HGM] wild: for wild-card pieces rt and rf are dummies if(piece == WhiteFalcon || piece == BlackFalcon || piece == WhiteCobra || piece == BlackCobra) - wildCard = TRUE; + wildCard = !pieceDefs; // no wildcards when engine defined pieces if ((cl->pieceIn == EmptySquare || cl->pieceIn == board[rf][ff] || PieceToChar(board[rf][ff]) == '~' @@ -2131,7 +2131,7 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) return; } } - } else if(pieceDefs && closure->count > 1) { // [HGM] gen: move is ambiguous under engine-defined rules + } else if(pieceDefs && closure->count > 1 && closure->rtIn >=0) { // [HGM] gen: move is ambiguous under engine-defined rules (and not one-click) DisambiguateClosure spare = *closure; pieceDefs = FALSE; spare.count = 0; // See if the (erroneous) built-in rules would resolve that GenLegal(board, flags, DisambiguateCallback, (VOIDSTAR) &spare, closure->pieceIn);