When in a variant with fixed promotion, such as Makruk, the promotion
piece did not participate, this led to disappearence of the piece, and
an =. suffix in SAN. This is relevant for the Makruk variant Ai-Wok,
which replaces the Met by a much more powerful Ai-Wok, which could not
be represented by another XBoard piece type due to this problem.
Now we search through the pieceToCharTable until a valid piece is found,
which works when the Ai-Wok is represented by a SMIRF Archbishop symbol.
// we either have a choice what to promote to, or (in Shogi) whether to promote
if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier ||
gameInfo.variant == VariantMakruk || gameInfo.variant == VariantASEAN) {
- *promoChoice = PieceToChar(BlackFerz); // no choice
+ ChessSquare p=BlackFerz; // no choice
+ while(p < EmptySquare) { //but make sure we use piece that exists
+ *promoChoice = PieceToChar(p++);
+ if(*promoChoice != '.') break;
+ }
return FALSE;
}
// no sense asking what we must promote to if it is going to explode...