From: H.G.Muller Date: Sat, 6 Jul 2019 13:52:32 +0000 (+0200) Subject: Interpret UCI2WB's invalid pieceToCharTable X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2ec94c4dd074b616f6c6e6eb93ad656c03762f27;p=xboard.git Interpret UCI2WB's invalid pieceToCharTable UCI2WB sends an invalid pieceToCharTable "-" in its setup command for engine-defined variants. This would keep the pieceToChar assignment of the parent variant (in UCI2WB's case always 'fairy'). Now this is replaced by the pieceToCharTable for variant normal, as the UCI engines that use this feature only support variants with orthodox pieces. --- diff --git a/backend.c b/backend.c index 77baf51..b6088f6 100644 --- a/backend.c +++ b/backend.c @@ -9327,8 +9327,9 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(appData.icsActive || forwardMostMove != 0 || cps != &first) return; *buf = NULLCHAR; if(sscanf(message, "setup (%s", buf) == 1) { - s = 8 + strlen(buf), buf[s-9] = NULLCHAR, SetCharTableEsc(pieceToChar, buf, SUFFIXES); - ASSIGN(appData.pieceToCharTable, buf); + char *ptc = strlen(buf) < 3 ? "PNBRQKpnbrqk" : buf; + s = 8 + strlen(buf), buf[s-9] = NULLCHAR, SetCharTableEsc(pieceToChar, ptc, SUFFIXES); + ASSIGN(appData.pieceToCharTable, ptc); } dummy = sscanf(message+s, "%dx%d+%d_%s", &w, &h, &hand, varName); if(dummy >= 3) {