From e9ab870ddf0840e4206da403934d97019d28e36b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 21 Oct 2013 21:03:24 +0200 Subject: [PATCH] Fix disambiguation of shogi-style promotions --- moves.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/moves.c b/moves.c index fba01a7..978d895 100644 --- a/moves.c +++ b/moves.c @@ -1764,6 +1764,10 @@ Disambiguate (Board board, int flags, DisambiguateClosure *closure) else c = PieceToChar(BlackQueen); } else if(c == '=') closure->kind = IllegalMove; // no deferral outside Shogi + } else if (c == '+') { // '+' outside shogi, check if pieceToCharTable enabled it + ChessSquare p = closure->piece; + if(p > WhiteMan && p < BlackPawn || p > BlackMan || PieceToChar(PROMOTED p) != '+') + closure->kind = ImpossibleMove; // used on non-promotable piece } else if (c != NULLCHAR) closure->kind = IllegalMove; closure->promoChar = ToLower(c); // this can be NULLCHAR! Note we keep original promoChar even if illegal. -- 1.7.0.4