Fix setting up btm positions with 'edit'
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 26 Jul 2016 20:04:14 +0000 (22:04 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 26 Jul 2016 20:04:14 +0000 (22:04 +0200)
The kludge to put black on move through a2a3 only works when there is
a (normally moving) Pawn on a2. Otherwise the 'black' command has to be
used. But this did take the engine out of force mode. So now we send
another 'force' command after this 'black'.

backend.c

index 48695ad..5c37e3e 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -6498,7 +6498,7 @@ SendBoard (ChessProgramState *cps, int moveNum)
        * deprecated "black" command.
        */
       if (!WhiteOnMove(moveNum)) // [HGM] but better a deprecated command than an illegal move...
-        SendToProgram(boards[0][1][BOARD_LEFT] == WhitePawn ? "a2a3\n" : "black\n", cps);
+        SendToProgram(boards[0][1][BOARD_LEFT] == WhitePawn && !pieceDesc[WhitePawn] ? "a2a3\n" : "black\nforce\n", cps);
 
       if(!cps->extendedEdit) left = BOARD_LEFT, right = BOARD_RGHT; // only board proper