tlim2 = 1.9*targetTime;\r
nodes = 0;\r
MapFromScratch(attacks);\r
+ retMove = INVALID;\r
score = Search(-INF-1, INF+1, rootEval, 20, sup1, sup2);\r
*move = retMove;\r
*ponderMove = INVALID;\r
score = SearchBestMove(stm, timeLeft, mps, timeControl, inc, timePerMove, &move, &ponderMove);\r
\r
if(move == INVALID) { // game apparently ended\r
+ int kcapt = 0, xstm = stm ^ WHITE, king, k = p[king=royal[xstm]].pos;\r
+ if( k != ABSENT) { // test if King capture possible\r
+ if(attacks[2*k + stm]) {\r
+ if( p[king + 2].pos == ABSENT ) kcapt = 1; // we have an attack on his only King\r
+ }\r
+ } else { // he has no king! Test for attacks on Crown Prince\r
+ k = p[king + 2].pos;\r
+ if(attacks[2*k + stm]) kcapt = 1; // we have attack on Crown Prince\r
+ }\r
+ if(kcapt) { // print King capture before claiming\r
+ GenCapts(k, 0);\r
+ printf("move %s\n", MoveToText(moveStack[msp-1], 1));\r
+ }\r
engineSide = NONE; // so stop playing\r
PrintResult(stm, score);\r
} else {\r