From: H.G. Muller Date: Wed, 28 Dec 2011 13:28:18 +0000 (+0100) Subject: Fix illegal-move message on seirawan gating from gated pieces X-Git-Tag: 4.8S~20 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=5dc87dcd0d60262efa7b5ce308b100371f72bc3d;p=fairymax.git Fix illegal-move message on seirawan gating from gated pieces Entering a gating move hen an already-gated piece left the back rank as interpreted as a on-gating move, rather than rejected. This because gating moves with non-virgin pieces were interpreted as non-gating promotions. The test for true promotions is now done on piece type rather than virginity. --- diff --git a/fairymax.c b/fairymax.c index dfa3ea6..5106ae1 100644 --- a/fairymax.c +++ b/fairymax.c @@ -876,7 +876,7 @@ int main(int argc, char **argv) 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]&32) GT = 0; // non-virgin mover => true promotion rather than gating + 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 */ printf("Illegal move:%s\n", line);