X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=5106ae1dd2c255c2640e9a23fce6bb922dc4f99d;hb=5dc87dcd0d60262efa7b5ce308b100371f72bc3d;hp=83002e538d0526cf796063384c5eb097906a8697;hpb=28d45d9a9d1df30f7230bbdbbec81e3eb9c9276c;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 83002e5..5106ae1 100644 --- a/fairymax.c +++ b/fairymax.c @@ -68,10 +68,10 @@ int StartKey; #endif /* make unique integer from engine move representation */ -#define PACK_MOVE 256*K + L + (PromPiece << 16); +#define PACK_MOVE 256*K + L + (PromPiece << 16) + (GT<<24); /* convert intger argument back to engine move representation */ -#define UNPACK_MOVE(A) K = (A)>>8 & 255; L = (A) & 255; PromPiece = (A)>>16 & 255; +#define UNPACK_MOVE(A) K = (A)>>8 & 255; L = (A) & 255; PromPiece = (A)>>16 & 255; GT = (A)>>24 & 255; /* Global variables visible to engine. Normally they */ /* would be replaced by the names under which these */ @@ -876,7 +876,7 @@ int main(int argc, char **argv) if(b[L] && (b[L]&16) == Side && w[b[L]&15] < 0) // capture own King: castling { i=K; K = L; L = i>L ? i-1 : i+2; } if(w[GT&15] < -1) pl[GT&31]++, J+=89729; // promotion to royal piece - if(b[K]&32) GT = 0; // non-virgin mover => true promotion rather than gating + if((b[K]&15) < 3) GT = 0; // Pawn => true promotion rather than gating if(D(Side,-I,I,Q,O,LL|S,3)!=I) { /* did have move syntax, but illegal move */ printf("Illegal move:%s\n", line);