Allow drops / promotions/ deferrals to be edited into book
authorH.G. Muller <h.g.muller@hccnet.nl>
Mon, 26 Aug 2013 09:37:27 +0000 (11:37 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Tue, 27 Aug 2013 07:38:25 +0000 (09:38 +0200)
For no real reason only NormalMove would be accepted when parsing the list
of book moves.

book.c

diff --git a/book.c b/book.c
index e491615..2bb542f 100644 (file)
--- a/book.c
+++ b/book.c
@@ -757,7 +757,9 @@ TextToMoves (char *text, int moveNum, entry_t *entries)
            if(w == 1) text = strstr(text, "1 ") + 2; // skip weight that could be recognized as move number one
            valid = ParseOneMove(text, moveNum, &moveType, &fromX, &fromY, &toX, &toY, &promoChar);
            text = strstr(text, yy_textstr) + strlen(yy_textstr); // skip what we parsed
-           if(!valid || moveType != NormalMove) continue;
+           if(!valid || moveType != NormalMove && moveType != WhiteDrop && moveType != BlackDrop
+                                                && moveType != WhitePromotion && moveType != BlackPromotion
+                                                && moveType != WhiteNonPromotion && moveType != BlackNonPromotion) continue;
            if(*text == ' ' && sscanf(text+1, "{%hd/%hd}", &entries[count].learnPoints, &entries[count].learnCount) == 2) {
                text = strchr(text+1, '}') + 1;
            } else {