From: H.G. Muller Date: Mon, 5 Jul 2010 08:00:01 +0000 (+0200) Subject: Fix parsing of SAN shogi promotions X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0f8af5270ac41f2b66af445c5eaf35ba9c55cb68;p=xboard.git Fix parsing of SAN shogi promotions A missing promotion character defaults to promotion in the move type, but the promotion character was not set when this happened in variant shogi. And it is especially important there, as the promotion character '+' will always be missing, as the parser will take it to be a 'check' symbol, and strip it from the move. --- diff --git a/moves.c b/moves.c index af04d1e..f281aa7 100644 --- a/moves.c +++ b/moves.c @@ -1284,7 +1284,7 @@ void Disambiguate(board, flags, closure) closure->kind = c == '=' ? IllegalMove : WhitePromotionKnight; else /* promotion optional, default is promote */ closure->kind = c == '=' ? NormalMove : WhitePromotionQueen; - + if(c != '=') closure->promoCharIn = 'q'; } else closure->kind = (c == NULLCHAR || c == 'x' || c == '=') ? NormalMove : IllegalMove; } else { @@ -1294,7 +1294,7 @@ void Disambiguate(board, flags, closure) closure->kind = c == '=' ? IllegalMove : BlackPromotionKnight; else /* promotion optional, default is promote */ closure->kind = c == '=' ? NormalMove : BlackPromotionQueen; - + if(c != '=') closure->promoCharIn = 'q'; } else closure->kind = (c == NULLCHAR || c == 'x' || c == '=') ? NormalMove : IllegalMove; }