From 1f7d5904dd33df6234de598651087809dc1cbd2f Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 9 May 2010 22:07:30 +0200 Subject: [PATCH] Fix bug in sending "usermove" when forcing book moves The keyword "usermove" was copied to the buffer, but not sent before it was overwritten by the actual book move. --- backend.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 53799ec..36a7ea2 100644 --- a/backend.c +++ b/backend.c @@ -6962,8 +6962,7 @@ char *SendMoveToBookUser(int moveNr, ChessProgramState *cps, int initial) // after a book hit we never send 'go', and the code after the call to this routine // has '&& !bookHit' added to suppress potential sending there (based on 'firstMove'). char buf[MSG_SIZ]; - if (cps->useUsermove) sprintf(buf, "usermove "); // sorry, no SAN yet :( - sprintf(buf, "%s\n", bookHit); // force book move into program supposed to play it + sprintf(buf, "%s%s\n", (cps->useUsermove ? "usermove " : ""), bookHit); // force book move into program supposed to play it SendToProgram(buf, cps); if(!initial) firstMove = FALSE; // normally we would clear the firstMove condition after return & sending 'go' } else if(initial) { // 'go' was needed irrespective of firstMove, and it has to be done in this routine -- 1.7.0.4