Fix RxK castling from engine in variant seirawan
[xboard.git] / backend.c
index 0e0a5b8..c531656 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -952,6 +952,7 @@ SaveEngineList ()
 void
 AddToEngineList (int i)
 {
+    if(addToList) {
        int len;
        char quote, buf[MSG_SIZ];
        char *q = firstChessProgramNames, *p = newEngineCommand;
@@ -975,6 +976,7 @@ AddToEngineList (int i)
        SaveEngineList();
        FloatToFront(&appData.recentEngineList, buf);
        ASSIGN(currentEngine[i], buf);
+    }
 }
 
 void
@@ -9055,7 +9057,7 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h
                 GameEnds(cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins,
                            buf1, GE_XBOARD);
                return;
-           } else if(!appData.fischerCastling)
+           } else if(!appData.fischerCastling && toX != BOARD_WIDTH>>1)
            /* [HGM] Kludge to handle engines that send FRC-style castling
               when they shouldn't (like TSCP-Gothic) */
            switch(moveType) {