X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;h=26010a201e2b1b68af1af5d6455cae5060a1c6c1;hp=7f90ba6a4b49abe6292b652f38aa5c9d49628bbd;hb=1b936bccc1ce09ac1ea15a4186b3bbc51eacaaf8;hpb=f84557e71a1d0ef09d2d0b8331ca17775a50671d diff --git a/UCI2WB.c b/UCI2WB.c index 7f90ba6..26010a2 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -171,6 +171,8 @@ Engine2GUI() line[13] = '=', line[14] = 0; } } + if(line[9] == 'e' && (line[14] == 'a' || line[14] == 'h')) // seirawan castling + gating at Rook + line[9] = line[14], line[11] = 'e'; // convert to RxK notation printf("move %s\n", line+9); // send move to GUI if(lastScore == 100001 && iniPos[0] != 'f') { printf("%s {mate}\n", stm == WHITE ? "1-0" : "0-1"); computer = NONE; } stm = WHITE+BLACK - stm; @@ -282,6 +284,11 @@ GUI2Engine() else if(line[13] != '\n') line[13] = '+'; // cater to WB 4.4 bug :-( } sscanf(line, "usermove %s", command); // strips off linefeed + if(command[4] && (command[1] == '1' || command[1] == '8')) { // seirawan gating + command[5] = command[0], command[6] = command[1], command[7] = '\0'; + if(command[2] == 'e' && (command[0] == 'a' || command[0] == 'h')) + command[2] = (command[0]+command[2]+1)>>1, command[0] = 'e'; // gating at Rook + } stm = WHITE+BLACK - stm; // when pondering we either continue the ponder search as normal search, or abort it if(pondering || computer == ANALYZE) { @@ -292,7 +299,8 @@ GUI2Engine() } StopPonder(1); } - sscanf(line, "usermove %s", move[moveNr++]); // possibly overwrites ponder move +// sscanf(line, "usermove %s", move[moveNr++]); // possibly overwrites ponder move + strcpy(move[moveNr++], command); } else if(!strcmp(command, "level")) { int sec = 0;