From: H.G.Muller Date: Thu, 25 Sep 2014 17:11:21 +0000 (+0200) Subject: Always accept piece commands in partly supported variants X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=90023cb65d9c783d7f045f839dec64292f50e524;p=xboard.git Always accept piece commands in partly supported variants Normally piece commands are ignored when legality checking is on, as XBoard's idea of legality should obviously overrule the engine's. In variants that are not or only partly supported, however, XBoard has no own idea of what is legal, so it is better to take the engine's advice than enforcing wrong rules. --- diff --git a/backend.c b/backend.c index ec9cfbb..9495083 100644 --- a/backend.c +++ b/backend.c @@ -8893,7 +8893,11 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h if(sscanf(message, "piece %s %s", buf2, buf1) == 2) { ChessSquare piece = WhitePawn; char *p=buf2; - if(cps != &first || appData.testLegality) return; + if(cps != &first || appData.testLegality && *engineVariant == NULLCHAR + /* For variants we don't have */ && gameInfo.variant != VariantBerolina + /* correct rules for, we cannot */ && gameInfo.variant != VariantCylinder + /* enforce legality on our own! */ && gameInfo.variant != VariantUnknown + && gameInfo.variant != VariantFairy ) return; if(*p == '+') piece = CHUPROMOTED WhitePawn, p++; piece += CharToPiece(*p) - WhitePawn; if(piece < EmptySquare) {