X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=9712e8fce55a487ed82792c921cbf3c0d5d95550;hb=2f50821e4f038bbe440b4c23403147fb9c5e35f6;hp=a8a44cba5e64e100f4fabf832e80141d5bfecc89;hpb=19c346df37adc6e9ac46315de74f1d6bb33fdc07;p=xboard.git diff --git a/backend.c b/backend.c index a8a44cb..9712e8f 100755 --- a/backend.c +++ b/backend.c @@ -2016,8 +2016,7 @@ VariantSwitch(Board board, VariantClass newVariant) } else gameInfo.variant = newVariant; CopyBoard(oldBoard, board); // remember correctly formatted board InitPosition(FALSE); /* this sets up board[0], but also other stuff */ - if(currentMove == 0) CopyBoard(board, oldBoard); // preserve start position - DrawPosition(TRUE, boards[currentMove]); + DrawPosition(TRUE, currentMove ? boards[currentMove] : oldBoard); } static int loggedOn = FALSE; @@ -3261,6 +3260,7 @@ read_from_ics(isr, closure, data, count, error) /* Usually suppress following prompt */ if (!(forwardMostMove == 0 && gameMode == IcsExamining)) { + while(looking_at(buf, &i, "\n")); // [HGM] skip empty lines if (looking_at(buf, &i, "*% ")) { savingComment = FALSE; } @@ -3579,7 +3579,7 @@ ParseBoard12(string) timeIncrement = increment * 1000; movesPerSession = 0; gameInfo.timeControl = TimeControlTagValue(); - VariantSwitch(board, StringToVariant(gameInfo.event) ); + VariantSwitch(boards[currentMove], StringToVariant(gameInfo.event) ); if (appData.debugMode) { fprintf(debugFP, "ParseBoard says variant = '%s'\n", gameInfo.event); fprintf(debugFP, "recognized as %s\n", VariantName(gameInfo.variant));