From 95996bd376f95541530f66cf27ad54949cb46d3c Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 10 Nov 2016 09:55:40 +0100 Subject: [PATCH] Suppress 'setup' command for some standard variants Receiving an 'info string variant' from the engine now not automatically leads to emission of a 'setup' command to the GUI. Because currently such a setup command contains defaults for info not supplied in the 'info' command, such as holdings size and pieceToChar, we suppress this in some standard variants where this would be harmful (such as crazyhouse). Such that the GUI does not get wrongly configured when playing these variants with legality testing off. Before, the setup command was only suppressed in variant normal. --- UCI2WB.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index 079960d..dddb073 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -30,7 +30,8 @@ #include // Set VARIANTS for in WinBoard variant feature. (With -s option this will always be reset to use "shogi".) -# define VARIANTS "normal,xiangqi" +#define VARIANTS "normal,xiangqi" +#define STDVARS "chess,chess960,crazyhouse,threecheck,giveaway,atomic,seirawan,shogi,xiangqi" #define DPRINT if(debug) printf @@ -281,7 +282,7 @@ Engine2GUI() char *pv, varName[80]; if(sscanf(line+5, "string times @ %c", &dummy) == 1) { printf("# %s", line+12); continue; } if(sscanf(line+5, "string variant %s", varName) == 1) { - if(strcmp(varName,"chess") && (p = strstr(line+18, " startpos "))) printf("setup (-) 8x8+0_fairy %s", p+10); + if(!strstr(STDVARS, varName) && (p = strstr(line+18, " startpos "))) printf("setup (-) 8x8+0_fairy %s", p+10); continue; } if(collect && (pv = strstr(line+5, "currmove "))) { -- 1.7.0.4