From 2ce85eeb80b638776c971733316052337ea363b0 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 27 Oct 2014 23:46:39 +0100 Subject: [PATCH] Fix extracting side-to-move from setboard command When white was to move, the stm was just keeping its previous value, which could very well have been BLACK. --- UCI2WB.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index 3035c94..b92e975 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -369,7 +369,7 @@ GUI2Engine() Sync(PAUSE); // wait for uciok } else if(!strcmp(command, "setboard")) { - if(strstr(line+9, " b ")) stm = BLACK; + stm = (strstr(line+9, " b ") ? BLACK : WHITE); if(p = strchr(line+9, '[')) { char c; *p++ = 0; q = strchr(p, ']'); *q = 0; r = q + 4; if(sc == 's') q[2] = 'w' + 'b' - q[2], strcpy(r=q+3, " 1\n"); // Shogi: reverse color -- 1.7.0.4