From 2ec94c4dd074b616f6c6e6eb93ad656c03762f27 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 6 Jul 2019 15:52:32 +0200 Subject: [PATCH] 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. --- backend.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 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) { -- 1.7.0.4