X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=46b3890cdafdbb0c39b4149e15d7cc401e942ec8;hb=refs%2Fheads%2Fpairomax;hp=f9cf637321c720eebfb1343d14b0fc2ab1fb72b1;hpb=d6d1661439273061a219ec84a818d4a589e41427;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index f9cf637..46b3890 100644 --- a/fairymax.c +++ b/fairymax.c @@ -491,7 +491,7 @@ void PrintOptions() void LoadGame(char *name) { - int i, j, ptc, count=0; char c, buf[80], pieceToChar[80]; + int i, j, ptc, count=0; char c, buf[80], pieceToChar[80], parent[80]; static int currentVariant; FILE *f; @@ -509,7 +509,7 @@ void LoadGame(char *name) if(!strcmp(name, "makruk") && Cambodian) name = "cambodian"; else if(!strcmp(name, "fairy")) name = selectedFairy; gating = !strcmp(name, "seirawan"); - while((ptc=fscanf(f, "Game: %s # %s", buf, pieceToChar))==0 || strcmp(name, buf) ) { + while((ptc=fscanf(f, "Game: %s # %s %s", buf, pieceToChar, parent))==0 || strcmp(name, buf) ) { while((c = fgetc(f)) != EOF && c != '\n'); count++; if(c == EOF) { @@ -552,8 +552,9 @@ void LoadGame(char *name) fclose(f); sh = w[7] < 250 ? 3 : 0; makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions - if(name == selectedFairy) { - printf(ptc == 1 ? "setup " : "setup (%s) ", pieceToChar); // setup board in GUI + if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN + if(ptc == 2) printf("setup (%s) ", pieceToChar); + else printf("setup (%s) %dx%d+0_%s", pieceToChar, BW, BH, parent); for(i=0; i