From: H.G.Muller Date: Sat, 4 Oct 2014 17:59:13 +0000 (+0200) Subject: Don't preserve setup position on board-size change X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d6897c980542d3ac3d1e9d47fed19766e4d87b63;p=xboard.git Don't preserve setup position on board-size change Normally the setup command sent by an engine is ignored if the user already has set up a position, to not render it impossible to do the latter. But if the setup command orders a different board size nothing the user has set up can possibly remain valid. --- diff --git a/backend.c b/backend.c index bedeead..329901e 100644 --- a/backend.c +++ b/backend.c @@ -8877,7 +8877,6 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h s = 8 + strlen(buf), buf[s-9] = NULLCHAR, SetCharTable(pieceToChar, buf); ASSIGN(appData.pieceToCharTable, buf); } - if(startedFromSetupPosition) return; dummy = sscanf(message+s, "%dx%d+%d_%s", &w, &h, &hand, varName); if(dummy >= 3) { while(message[s] && message[s++] != ' '); @@ -8887,8 +8886,10 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(dummy == 4) gameInfo.variant = StringToVariant(varName); // parent variant InitPosition(1); // calls InitDrawingSizes to let new parameters take effect if(*buf) SetCharTable(pieceToChar, buf); // do again, for it was spoiled by InitPosition + startedFromSetupPosition = FALSE; } } + if(startedFromSetupPosition) return; ParseFEN(boards[0], &dummy, message+s, FALSE); DrawPosition(TRUE, boards[0]); startedFromSetupPosition = TRUE;