X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=ce2d7ae4e2eea85d5bfebc5ee51622235824ae48;hb=cdb80be80d2895990ffe4b3f88ab566e5553ca3c;hp=072e67fbefa830312564e80dba606ea508d96178;hpb=624ef92257cf0512856552f09080c68fdae1f6ee;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 072e67f..ce2d7ae 100644 --- a/fairymax.c +++ b/fairymax.c @@ -93,7 +93,7 @@ int Resign; int Threshold = 800; int Score; int makruk; -int prom, pm; +int prom, pm, gating; char piecename[32], piecetype[32], blacktype[32]; char selectedFairy[80]; char *inifile = INI_FILE; @@ -389,6 +389,7 @@ InitGame() R -= 2*(-k/FAC); UnderProm = -1; pl[WHITE] = pl[BLACK] = 2*BW; pm = !pl[BLACK+7] && pl[BLACK+9] && pl[WHITE+7] ? 2 : 0; // Unlike white, black has no 'Q', so promote to 9, which he does have. + if(gating) pl[13] = pl[15] = pl[29] = pl[31] = 1, R += 2*(w[6]/FAC + w[8]/FAC); } void CopyBoard(int s) @@ -454,9 +455,11 @@ int LoadGame(char *name) if(fscanf(f, "version 4.8(%c)", &c)!=1 || c != 'w') { printf("telluser incompatible fmax.ini file\n"); exit(0); } + gating = 0; if(name != NULL) { /* search for game name in definition file */ - if(!strcmp(name, "fairy")) name = selectedFairy; + if(!strcmp(name, "fairy")) name = selectedFairy; + gating = !strcmp(name, "seirawan"); while((ptc=fscanf(f, "Game: %s # %s", buf, pieceToChar))==0 || strcmp(name, buf) ) { while((c = fgetc(f)) != EOF && c != '\n'); count++; @@ -784,7 +787,6 @@ int main(int argc, char **argv) sscanf(line, "variant %s", command); LoadGame(command); InitGame(); Setup = 0; - if(strstr(command,"seirawan")) pl[13] = pl[15] = pl[29] = pl[31] = 1, R += 2*(w[6]/FAC + w[8]/FAC); continue; } if (!strcmp(command, "edit")) {