From 657f41628b1ea266fe8e09da9d4507be4d3ff630 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 11 Feb 2013 22:20:45 +0100 Subject: [PATCH] Update piece counts on all (game-level) promotions The piece count was only updated for entered moves in case of promotion to royalty (which only occurs in Spartan, as underpromotion, so Fairy-Max would never do it by itself). This is now moved to the 'first-floor exit', where it is done for any game move and any piece type, so that piece count pl[] are completely reliable in the root. (Preparing their use for determination of mating potential.) --- fairymax.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fairymax.c b/fairymax.c index 9782ba4..ec6c6ca 100644 --- a/fairymax.c +++ b/fairymax.c @@ -232,7 +232,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ {if(v+I&&x==K&y==L>==GT) /* if move found */ {Q=-e-i;O=F;LL=L;prom=gt; if(b[y]-u&15)prom=b[y]-=PromPiece, /* under-promotion, correct */ - Z+=PromPiece; /* piece & invalidate hash */ + pl[u&31]--,pl[prom&31]++,Z+=PromPiece;/*piece & invalidate hash */ a->D=99;a->V=0; /* lock game in hash as draw*/ R-=i/FAC; /*** total captd material ***/ Fifty = t|p<3?0:Fifty+1; @@ -889,7 +889,6 @@ int main(int argc, char **argv) else { int i=-1; 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]&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 */ -- 1.7.0.4