X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=bc25c5fa9d10467020fc19f26b7a031ff11bfcc0;hb=19fb94c81f006ac504fdb3bf70ed34985de702cd;hp=265a55c249d6d43b29cfe88bba0cd274e4bdce54;hpb=f8c35eb754cb56fb821bb45e87fd7a27e9ccb594;p=xboard.git diff --git a/backend.c b/backend.c index 265a55c..bc25c5f 100644 --- a/backend.c +++ b/backend.c @@ -2446,6 +2446,7 @@ VariantSwitch (Board board, VariantClass newVariant) board[i][j+newHoldingsWidth-gameInfo.holdingsWidth] = board[i][j]; } + board[HOLDINGS_SET] = 0; gameInfo.boardWidth = newWidth; gameInfo.boardHeight = newHeight; gameInfo.holdingsWidth = newHoldingsWidth; @@ -4313,6 +4314,7 @@ ParseBoard12 (char *string) } if (gameInfo.boardHeight != ranks || gameInfo.boardWidth != files || + move_str[1] == '@' && !gameInfo.holdingsWidth || weird && (int)gameInfo.variant < (int)VariantShogi) { /* [HGM] We seem to have switched variant unexpectedly * Try to guess new variant from board size @@ -4322,7 +4324,8 @@ ParseBoard12 (char *string) if(ranks == 10 && files == 9) newVariant = VariantXiangqi; else if(ranks == 8 && files == 12) newVariant = VariantCourier; else if(ranks == 9 && files == 9) newVariant = VariantShogi; else - if(!weird) newVariant = VariantNormal; + if(ranks == 10 && files == 10) newVariant = VariantGrand; else + if(!weird) newVariant = move_str[1] == '@' ? VariantCrazyhouse : VariantNormal; VariantSwitch(boards[currentMove], newVariant); /* temp guess */ /* Get a move list just to see the header, which will tell us whether this is really bug or zh */