fix for bug #27668: e.p. field still not passed to engine
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 11 Oct 2009 21:48:55 +0000 (14:48 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 11 Oct 2009 21:48:55 +0000 (14:48 -0700)
PositionToFEN now takes the e.p. rights from epStatus[moveNr], rather than
calculating it on the spot from moveList[moveNr-1] (which failed on the first move).

backend.c

index afd2196..29f55db 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -13498,6 +13498,14 @@ PositionToFEN(move, overrideCastling)
        } else {
            *p++ = '-';
        }
+    } else if(move == backwardMostMove) {
+       // [HGM] perhaps we should always do it like this, and forget the above?
+       if(epStatus[move] >= 0) {
+           *p++ = epStatus[move] + AAA;
+           *p++ = whiteToPlay ? '6'+BOARD_HEIGHT-8 : '3';
+       } else {
+           *p++ = '-';
+       }
     } else {
        *p++ = '-';
     }