Allow promotion to Pawn with legality testing off
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 28 Jan 2011 18:20:38 +0000 (19:20 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 26 Jun 2011 12:36:04 +0000 (14:36 +0200)
In stead of ImpossibleMove promotionto Pawn now merely is an
IllegalMove, so it can be played with legality testing off.

moves.c

diff --git a/moves.c b/moves.c
index dcb4300..3bbf526 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -1194,7 +1194,7 @@ if(appData.debugMode)fprintf(debugFP,"SHOGI promoChar = %c\n", promoChar ? promo
                    for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++) kings += (board[r][f] == BlackKing);
                    if(kings == 2) cl.kind = IllegalMove;
                }
                    for(r=0; r<BOARD_HEIGHT; r++) for(f=BOARD_LEFT; f<BOARD_RGHT; f++) kings += (board[r][f] == BlackKing);
                    if(kings == 2) cl.kind = IllegalMove;
                }
-           } else if(piece == WhitePawn || piece == BlackPawn) cl.kind = ImpossibleMove; // cannot stay Pawn in any variant
+           } else if(piece == WhitePawn || piece == BlackPawn) cl.kind = IllegalMove; // cannot stay Pawn in any variant
            else if((piece == WhiteUnicorn || piece == BlackUnicorn) && gameInfo.variant == VariantKnightmate)
              cl.kind = IllegalMove; // promotion to Royal Knight not allowed
            else if((piece == WhiteKing || piece == BlackKing) && gameInfo.variant != VariantSuicide && gameInfo.variant != VariantGiveaway)
            else if((piece == WhiteUnicorn || piece == BlackUnicorn) && gameInfo.variant == VariantKnightmate)
              cl.kind = IllegalMove; // promotion to Royal Knight not allowed
            else if((piece == WhiteKing || piece == BlackKing) && gameInfo.variant != VariantSuicide && gameInfo.variant != VariantGiveaway)