Support printing of piece command specified in ini file
[fairymax.git] / fairymax.c
index f80bfe3..f476379 100644 (file)
@@ -18,7 +18,7 @@
      /*****************************************************************/\r
 \r
 #define MULTIPATH\r
-#define VERSION "4.8S"\r
+#define VERSION "4.8T"\r
 \r
 #include <stdio.h>\r
 #include <stdlib.h>\r
@@ -343,6 +343,10 @@ int PrintResult(int s)
           differs: ;\r
         }\r
 \r
+\r
+\r
+\r
+\r
         K=I;\r
         cnt = D(s,-I,I,Q,O,LL|4*S,3);\r
 #ifdef SHATRANJ\r
@@ -466,7 +470,7 @@ void PrintOptions()
                                          \r
 void LoadGame(char *name)\r
 {\r
-        int i, j, ptc, count=0; char c, buf[80], pieceToChar[80], parent[80];\r
+        int i, j, ptc=0, count=0; char c, buf[80], pieceToChar[80], parent[80];\r
         static int currentVariant;\r
         FILE *f;\r
 \r
@@ -521,7 +525,6 @@ void LoadGame(char *name)
             c=0; if(i>15 || j>255) break;\r
         }\r
 \r
-        fclose(f);\r
        sh = w[7] < 250 ? 3 : 0;\r
         if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN\r
             if(ptc == 2) printf("setup (%s) ", pieceToChar);\r
@@ -534,6 +537,8 @@ void LoadGame(char *name)
             if(makruk) printf("8/");\r
             for(i=0; i<BW; i++) printf("%c", piecename[oo[i]]+'@'); printf(" w KQkq - 0 1\n");\r
         }\r
+       while(fscanf(f, " # %[^\n]", pieceToChar)) printf("piece %s\n", pieceToChar);\r
+        fclose(f);\r
 }\r
 \r
 int main(int argc, char **argv)\r
@@ -903,6 +908,8 @@ int main(int argc, char **argv)
                         CopyBoard(HistPtr=HistPtr+1&1023);\r
                         if(PrintResult(Side)) Computer = EMPTY;\r
                    }\r
+\r
                }\r
        }\r
+       return 0;\r
 }\r