From: H.G.Muller Date: Mon, 3 Mar 2014 13:44:00 +0000 (+0100) Subject: Allow passing command to InputCommand X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=978d019d1fbc6789be06ecd8564ea5393aaed373;p=gnushogi.git Allow passing command to InputCommand InputCommand was only called with argument command=NULL, but written such that it would execute the passed command rather than read one from stdin in other cases. (E.g. to execute a back-logged command.) But in such a case it should not ponder or analyze before processing the command, as these should only be done while waiting for true input. --- diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 9556f63..ba56401 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -1511,7 +1511,7 @@ InputCommand(char *command) ZeroTTable(); #endif - if ((hint > 0) && !flag.easy && !flag.force) + if ((hint > 0) && !flag.easy && !flag.force && !command) { /* * A hint move for the player is available. Compute a move for the @@ -1575,7 +1575,7 @@ InputCommand(char *command) { player = opponent; - if (flag.analyze) { + if (flag.analyze && !command) { SelectMove(opponent, BACKGROUND_MODE); }