X-Git-Url: http://winboard.nl/cgi-bin?p=bonanza.git;a=blobdiff_plain;f=proce.c;fp=proce.c;h=cb98efafaebc0b8eb0c8d2d5e7e077a94bbfe42b;hp=a08b5d9f033d932975273637b814edd9a74ddec3;hb=b254afaa5659484d8643f4aac1fb18245d7e0199;hpb=4106e127a492aa4c0f5f01112b824fcb678b2d52 diff --git a/proce.c b/proce.c index a08b5d9..cb98efa 100644 --- a/proce.c +++ b/proce.c @@ -136,6 +136,7 @@ int all_moves[MAX_LEGAL_MOVES]; int myTime, hisTime, movesPerSession, inc, plyNr; char xboard_mode; +int root_pos[nsquare]; int xboard_to_CSA( tree_t * restrict ptree, char *in, char *out, int status ) @@ -160,7 +161,7 @@ xboard_to_CSA( tree_t * restrict ptree, char *in, char *out, int status ) int flag = (promo == '+' ? FLAG_PROMO : 0); piece = abs( BOARD[from] ); // this only works when not searching! printf("# piece from board: %d\n", piece);fflush(stdout); - if( status & ( flag_pondering | flag_puzzling | flag_thinking ) ) { + if( status & flag_thinking ) { int i, to = ('9' - toY)*9 + (toX - 'a'), l = (status == (flag_pondering | flag_thinking)); piece = 0; // kludge to force illegal CSA move for( i = 0; l ? all_moves[i] : i < root_nmove; i++ ) { // determine the piece from the move list @@ -172,8 +173,8 @@ printf("# piece from board: %d\n", piece);fflush(stdout); bonanza_move = move; break; } + } else if( status & ( flag_pondering | flag_puzzling ) ) piece = abs( root_pos[from] ); // we have valid copy! printf("# piece corrected to %d\n", piece);fflush(stdout); - } if( promo ) piece += promote; sprintf(out, "%c%c%c%c%s", 'a'+'9'-fromX, '1'+'9'-fromY, 'a'+'9'-toX, '1'+'9'-toY, astr_table_piece[piece]); }