From 88785b48e8eff991f222cd7fa96a2b5ac6345fad Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 27 Apr 2016 20:34:45 +0200 Subject: [PATCH] Fix piece commands for promoted pieces The flexible partner assignment had broken the code for 'piece' commands defining the moves for these pieces, as the promotion partner was still calculated the old way. --- backend.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 4f6262a..83034f4 100644 --- a/backend.c +++ b/backend.c @@ -9146,10 +9146,10 @@ 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=message+6, *q, *s = SUFFIXES, ID = *p; - if(*p == '+') piece = CHUPROMOTED(WhitePawn), ID = *++p; + char *p=message+6, *q, *s = SUFFIXES, ID = *p, promoted = 0; + if(*p == '+') promoted++, ID = *++p; if(q = strchr(s, p[1])) ID += 64*(q - s + 1), p++; - piece += CharToPiece(ID & 255) - WhitePawn; + piece = CharToPiece(ID & 255); if(promoted) piece = CHUPROMOTED(piece); if(cps != &first || appData.testLegality && *engineVariant == NULLCHAR /* always accept definition of */ && piece != WhiteFalcon && piece != BlackFalcon /* wild-card pieces. */ && piece != WhiteCobra && piece != BlackCobra -- 1.7.0.4