From: H.G. Muller Date: Sat, 7 May 2011 14:21:25 +0000 (+0200) Subject: Fix resetting engine options X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7fb59a9a90f59e4e94ff49e2eb55ba7c24b2ef7b;p=xboard.git Fix resetting engine options Not all options were reset, and -needsNonCompliantFEN was 'reset' to a completely wrong value, so that bad FENs would be sent. --- diff --git a/backend.c b/backend.c index a0bffa5..2658402 100644 --- a/backend.c +++ b/backend.c @@ -864,6 +864,10 @@ ReplaceEngine(ChessProgramState *cps, int n) extern char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params; extern Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick; +static char resetOptions[] = + "-reuse -firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 " + "-firstOptions \"\" -firstNPS -1 -fn \"\""; + void Load(ChessProgramState *cps, int i) { @@ -871,7 +875,7 @@ Load(ChessProgramState *cps, int i) if(engineLine[0]) { // an engine was selected from the combo box snprintf(buf, MSG_SIZ, "-fcp %s", engineLine); SwapEngines(i); // kludge to parse -f* / -first* like it is -s* / -second* - ParseArgsFromString("-firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 -fn \"\""); + ParseArgsFromString(resetOptions); appData.fenOverride[0] = NULL; ParseArgsFromString(buf); SwapEngines(i); ReplaceEngine(cps, i); @@ -9557,14 +9561,12 @@ SetPlayer(int player) { // [HGM] find the engine line of the partcipant given by number, and parse its options. int i; char buf[MSG_SIZ], *engineName, *p = appData.participants; - static char resetOptions[] = "-reuse -firstIsUCI false -firstHasOwnBookUCI true -firstTimeOdds 1 -firstOptions \"\" " - "-firstNeedsNoncompliantFEN false -firstNPS -1 -fn \"\""; for(i=0; i