From 90023cb65d9c783d7f045f839dec64292f50e524 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 25 Sep 2014 19:11:21 +0200 Subject: [PATCH] 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. --- backend.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) 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) { -- 1.7.0.4