} UndoInfo;\r
\r
char *array, fenArray[4000], startPos[4000], *reason, checkStack[300];\r
-int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws, tsume, pvCuts, allowRep, entryProm;\r
+int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag, repDraws, stalemate, tsume, pvCuts, allowRep, entryProm;\r
int stm, xstm, hashKeyH=1, hashKeyL=1, framePtr, msp, nonCapts, rootEval, filling, promoDelta;\r
int retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore;\r
int ll, lr, ul, ur; // corner squares\r
chuFlag = (currentVariant == V_CHU || currentVariant == V_LION);\r
tenFlag = (currentVariant == V_TENJIKU);\r
chessFlag = (currentVariant == V_CHESS || currentVariant == V_LION);\r
- repDraws = (currentVariant == V_CHESS || currentVariant == V_SHATRANJ || currentVariant == V_MAKRUK || currentVariant == V_LION);\r
+ stalemate = (currentVariant == V_CHESS || currentVariant == V_MAKRUK || currentVariant == V_LION);\r
+ repDraws = (stalemate || currentVariant == V_SHATRANJ);\r
ll = 0; lr = bHeight - 1; ul = (bHeight - 1)*bWidth; ur = ul + bHeight - 1;\r
\r
for(i= -1; i<9; i++) { // board steps in linear coordinates\r
if(lmr && bestScore <= alpha && iterDep == depth)\r
depth++, lmr--; // self-deepen on fail-low reply to late move by lowering reduction\r
#endif\r
+ if(stalemate && bestScore == -INF && !inCheck) bestScore = 0; // stalemate\r
#ifdef HASH\r
// hash store\r
hashTable[index].lock[hit] = hashKeyH;\r