From 0f8af5270ac41f2b66af445c5eaf35ba9c55cb68 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 5 Jul 2010 10:00:01 +0200 Subject: [PATCH] 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. --- moves.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 1.7.0.4