Limit duple-check rule to piece types above 7
[fairymax.git] / fairymax.c
index 5b2e98a..0c1fc81 100644 (file)
@@ -181,7 +181,8 @@ int k,q,l,e,E,z,n;      /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/
       if(flag&1+!t)                            /* mode (capt/nonc) allowed?*/\r
       {if(t&&(t&16)==k)break;                  /* capture own              */\r
        i=w[t&15]+((t&192)>>sh);                /* value of capt. piece t   */\r
-       if(i<0&&(pl[t&31]<2||kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* K capture, duple check */\r
+       if(i<0&&(pl[t&31]<2||                   /* K capture, (of last K),  */\r
+        t>>3&kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* or duple check: cutoff*/\r
        if(m>=l&d>1)goto C;                     /* abort on fail high       */\r
        v=d-1?e:i-p;                            /*** MVV/LVA scoring if d=1**/\r
        if(d-!t>1)                              /*** all captures if d=2  ***/\r