From 7e24a85634e1c87710ad177419830f3ecafee7de Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 16 Feb 2013 17:55:38 +0100 Subject: [PATCH] Fix check extension Check extension in micro-Max was not be awarded when a piece other than King captured the checker. In the code this was still tested assuming the piece number of the King would always be 3, while in Fairy-Max every piece can be Royal, based on the sign of its piece value w[]. In many game definitions piece 3 was actually not a King at all. --- changelog | 1 + fairymax.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index 081204f..0586846 100644 --- a/changelog +++ b/changelog @@ -110,6 +110,7 @@ * Spurious result claims after under-promotion * False mate claims in Spartan when promotion to K was possible * Fix bug in Berolina e.p. capture that is actually non-capture + * Fix conditions for check extension on capture of checker * Fix Clear Hash option, which did not work at all * Fix addition of 6th & 7th-rank Pawn bonus when setting up position * set promotion bonus on (under-)promotion to true piece value diff --git a/fairymax.c b/fairymax.c index b236e4d..b5f0545 100644 --- a/fairymax.c +++ b/fairymax.c @@ -219,7 +219,7 @@ int k,q,l,e,ev,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ re=v>>Fac(v>>15&16^k); /* Reduce eval if drawish for leading side */ if(z&S)V=m-margin>q?m-margin:q; /* multiPV */ C=d-1-(d>5&p>2&!t&!h); /* nw depth, reduce non-cpt.*/ - C=R0?C:d; /* extend 1 ply if in-check */ do s=C>2|re>V?-D(16-k,-l,-V,/*** futility, recursive eval. of reply */ -v,-re,F,y&255,C):re; @@ -300,7 +300,7 @@ Fac(int k) h=pl[k]-pl[17-k]-pl[18-k]; /* his pieces (incl. King) */ if(h<2)r=0; /* bare K easy even w.o. P */ j=h-n; /* defenders after sac for P*/ - if(j<3&&j--){ /* can sac, <= 1 piece left */ + if(j<3&&j-->0){ /* can sac, <= 1 piece left */ i=18-k;W(!pl[++i]); /* get lowest piece */ e=abs(w[i--])*n; /* sac for Pawn (if any) */ W(h>1)h-=pl[++i],e-=pl[i]*w[i]; /* total value his remaining*/ -- 1.7.0.4