Fix bug in Berolina e.p. capture
[fairymax.git] / fairymax.c
index 792ceeb..20b63dd 100644 (file)
@@ -187,7 +187,7 @@ int k,q,l,e,E,z,n;      /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/
       }\r
 #endif\r
       m=E<16|(E^112)<16&&flag&1&y-E<2&E-y<2?I:m;      /* bad castling  */\r
-      if(p<3&y==E)H=z&127;                     /* shift capt.sqr. H if e.p.*/\r
+      if(p<3&y==E&flag)H=z&127;                /* shift capt.sqr. H if e.p.*/\r
       t=b[H];\r
       if(flag&1+!t)                            /* mode (capt/nonc) allowed?*/\r
       {if(t&&(t&16)==k)break;                  /* capture own              */\r