Seirawan gatings on castling
[capablanca.git] / lasker-2.2.3 / src / board.c
index 8c92473..40e7037 100644 (file)
@@ -181,9 +181,6 @@ int board_init(int g,struct game_state_t *b, char *category, char *board)
        sprintf(b->variant, "wild/%d", wval);
     }
 
-    if (board && !strcmp(board, "0"))
-       b->setup = 0; // [HGM] variant: any board in the default file "0" is supposed to be implied by the variant
-
     if (!strcmp(category, "knightmate")) {
       board_standard(b);
     } else if (!strcmp(category, "super")) {
@@ -386,6 +383,7 @@ char *board_to_string(char *wn, char *bn,
          game_globals.garray[b->gameNum].black_name);
   } else
     bstring[0] = '\0';
+
   if (bh && !IsMachineStyle(style))
     append_holding_display(bstring, b, orientation==BLACK);
 
@@ -998,6 +996,9 @@ static int board_read_file(char *category, char *gname, struct game_state_t *gs)
 
   board_clear(gs);
   gs->setup = 1;
+  if (gname && !strcmp(gname, "0"))
+       gs->setup = 0; // [HGM] variant: any board in the default file "0" is supposed to be implied by the variant
+
   while (!feof(fp)) {
     c = fgetc(fp);
     if (onNewLine) {