X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=backend.c;h=e2aa771d5874bacd19f014a18a756667d88dbf53;hp=756641cec0593992f96c8a4d740caab76fa804a9;hb=08d1691b8c734f49773076a001059a59812505d0;hpb=caf032a02b9d7a759529874d63bbcc31db671380 diff --git a/backend.c b/backend.c index 756641c..e2aa771 100755 --- a/backend.c +++ b/backend.c @@ -607,7 +607,7 @@ InitBackEnd1() ShowThinkingEvent(); // [HGM] thinking: make sure post/nopost state is set according to options GetTimeMark(&programStartTime); - srand(programStartTime.ms); // [HGM] book: makes sure random is unpredictabe to msec level + srandom(programStartTime.ms); // [HGM] book: makes sure random is unpredictabe to msec level ClearProgramStats(); programStats.ok_to_send = 1; @@ -3281,7 +3281,13 @@ read_from_ics(isr, closure, data, count, error) * to move the position two files to the right to * create room for them! */ - VariantSwitch(boards[currentMove], VariantCrazyhouse); /* temp guess */ + VariantClass newVariant; + switch(gameInfo.boardWidth) { // base guess on board width + case 9: newVariant = VariantShogi; break; + case 10: newVariant = VariantGreat; break; + default: newVariant = VariantCrazyhouse; break; + } + VariantSwitch(boards[currentMove], newVariant); /* temp guess */ /* Get a move list just to see the header, which will tell us whether this is really bug or zh */ if (ics_getting_history == H_FALSE) { @@ -3391,6 +3397,7 @@ ParseBoard12(string) char promoChar; int ranks=1, files=0; /* [HGM] ICS80: allow variable board size */ char *bookHit = NULL; // [HGM] book + Boolean weird = FALSE; fromX = fromY = toX = toY = -1; @@ -3406,6 +3413,7 @@ ParseBoard12(string) while(i < 199 && (string[i] != ' ' || string[i+2] != ' ')) { if(string[i] == ' ') { ranks++; files = 0; } else files++; + if(!strchr(" -pnbrqkPNBRQK" , string[i])) weird = TRUE; // test for fairies i++; } for(j = 0; j