Fix check extension
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 16 Feb 2013 17:05:46 +0000 (18:05 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sat, 16 Feb 2013 17:05:46 +0000 (18:05 +0100)
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
fairymax.c

index e8a3654..06089ba 100644 (file)
--- a/changelog
+++ b/changelog
           * 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
           * Adapt score by true piece value in case of (under-)promotion
index 6f420ae..769da7f 100644 (file)
@@ -218,7 +218,7 @@ int k,q,l,e,E,z,n;      /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/
         v+=e+i;V=m>q?m:q;                      /*** new eval & alpha    ****/\r
         if(z&S)V=m-margin>q?m-margin:q;        /* multiPV                  */\r
         C=d-1-(d>5&p>2&!t&!h);                 /* nw depth, reduce non-cpt.*/\r
-        C=R<EG|P-I|d<3||t&&p-3?C:d;            /* extend 1 ply if in-check */\r
+        C=R<EG|P-I|d<3||t&&w[p]>0?C:d;         /* extend 1 ply if in-check */\r
         do\r
          s=C>2|v>V?-D(16-k,-l,-V,-v,/*** futility, recursive eval. of reply */\r
                                      F,y&255,C):v;\r