X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=24558d52c6ea2f5d5fbcc3b6514dd8df4a32f412;hb=5a64b254d74da5a9bba1c40c51f8c32df3b1b002;hp=9495083aa91fce1df04f54ce255651fca63804cb;hpb=5bee433e9f42c5194734b2671dbbcfcf9068eab8;p=xboard.git diff --git a/backend.c b/backend.c index 9495083..24558d5 100644 --- a/backend.c +++ b/backend.c @@ -10486,7 +10486,19 @@ InitChessProgram (ChessProgramState *cps, int setup) b = SupportedVariant(cps->variants, gameInfo.variant, gameInfo.boardWidth, gameInfo.boardHeight, gameInfo.holdingsSize, cps->protocolVersion, cps->tidy); if (b == NULL) { - DisplayFatalError(variantError, 0, 1); + VariantClass v; + char c, *q = cps->variants, *p = strchr(q, ','); + if(p) *p = NULLCHAR; + v = StringToVariant(q); + DisplayError(variantError, 0); + if(v != VariantUnknown && cps == &first) { + int w, h, s; + if(sscanf(q, "%dx%d+%d_%c", &w, &h, &s, &c) == 4) // get size overrides the engine needs with it (if any) + appData.NrFiles = w, appData.NrRanks = h, appData.holdingsSize = s, q = strchr(q, '_') + 1; + ASSIGN(appData.variant, q); + Reset(TRUE, FALSE); + } + if(p) *p = ','; return; }