From d6897c980542d3ac3d1e9d47fed19766e4d87b63 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 4 Oct 2014 19:59:13 +0200 Subject: [PATCH] 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. --- backend.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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; -- 1.7.0.4