X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=hachu.c;h=68e0674bb07cdda7aa1db47320c4c851db4b6c4c;hb=1e2ac9a07ee60ab32e6740b2e8ebdcf8ca490d26;hp=9bc797c02cadae5aa38dc0b1a854dbaf257cf75b;hpb=5676d8e01a0b03b248b2108918874b795558d6c0;p=hachu.git diff --git a/hachu.c b/hachu.c index 9bc797c..68e0674 100644 --- a/hachu.c +++ b/hachu.c @@ -92,8 +92,8 @@ typedef struct { } UndoInfo; char *array, fenArray[4000], *reason; -int bWidth, bHeight, bsize, zone, currentVariant; -int stm, xstm, hashKeyH, hashKeyL, framePtr, msp, nonCapts, rootEval, retMSP, retFirst, retDep, pvPtr, level, cnt50, chuFlag=1, tenFlag, mobilityScore; +int bWidth, bHeight, bsize, zone, currentVariant, chuFlag, tenFlag, chessFlag; +int stm, xstm, hashKeyH, hashKeyL, framePtr, msp, nonCapts, rootEval, retMSP, retFirst, retDep, pvPtr, level, cnt50, mobilityScore; int nodes, startTime, tlim1, tlim2, repCnt, comp; Move retMove, moveStack[10000], path[100], repStack[300], pv[1000], repeatMove[300]; @@ -676,7 +676,7 @@ AddPiece (int stm, PieceDesc *list) if(p[j].promo >= i) p[j].promo += 2; } if(royal[stm] >= i) royal[stm] += 2; - if(p[i].value == (currentVariant == V_SHO ? 410 : 280) ) royal[stm] = i; + if(p[i].value == (currentVariant == V_SHO ? 410 : 280) ) royal[stm] = i, p[i].pst = 0; p[i].qval = (currentVariant == V_TENJIKU ? list->ranking : 0); // jump-capture hierarchy return i; } @@ -760,6 +760,7 @@ Init (int var) bsize = bWidth*bHeight; chuFlag = (currentVariant == V_CHU); tenFlag = (currentVariant == V_TENJIKU); + chessFlag = (currentVariant == V_CHESS); for(i= -1; i<9; i++) { // board steps in linear coordinates kStep[i] = STEP(direction[i&7].x, direction[i&7].y); // King @@ -945,8 +946,8 @@ GenNonCapts (int promoSuppress) } } else if(r == M) { // FIDE Pawn; check double-move - if(!NewNonCapture(x, x+v, pFlag) && promoBoard[x-v]) - NewNonCapture(x, x+2*v+DEFER, pFlag); // use promoSuppress flag as e.p. flag + if(!NewNonCapture(x, x+v, pFlag) && chessFlag && promoBoard[x-v]) + NewNonCapture(x, x+2*v, pFlag), moveStack[msp-1] |= DEFER; // use promoSuppress flag as e.p. flag } continue; } @@ -2232,7 +2233,7 @@ printf("in: %s\n", command); continue; } if(!strcmp(command, "variant")) { - for(i=0; i<5; i++) { + for(i=0; i<6; i++) { sscanf(inBuf+8, "%s", command); if(!strcmp(variants[i].name, command)) { Init(i); stm = Setup2(NULL); break;