From: H.G. Muller Date: Fri, 7 Oct 2011 14:28:00 +0000 (+0200) Subject: Fix virginity of pieces in setup position X-Git-Tag: 4.8R~6 X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=1f30c93b99e5b6d78b03f80cc2de0b4cf6d4eb1a Fix virginity of pieces in setup position Only royal and corner pieces got their virginity bits set when they started on the original location, because these bits were only used for castling. But this caused problems for the Met move in Cambodian Chess. There was in fact no reason not to extend this to all pieces. It might even solve a so far undetected problem in Seirawan. But in Makruk it isextra important, because WinBoard always considers that played from a setup position, because of the non-standard Pawn rank. --- diff --git a/fairymax.c b/fairymax.c index ba9672f..dea62b1 100644 --- a/fairymax.c +++ b/fairymax.c @@ -831,15 +831,12 @@ int main(int argc, char **argv) break; default: b[m]=p+color+32; // assume non-virgin + if(color==BLACK && m<0x10 && p==oo[m+16] || // but make virgin on original square + color==WHITE && m>0x6F && p==oo[m-0x70]) b[m] -= 32; if(w[p]<0) { // Royal piece on original square: virgin - if(color==BLACK && m<0x10 && p==oo[m+16] || - color==WHITE && m>0x6F && p==oo[m-0x70]) b[m] -= 32; Q-=w[p]; // assume value was flipped to indicate royalty if(pl[p+color])R-=w[p]/FAC; // capturable King, add to material } else { Q+=w[p]; R+=w[p]/FAC; } - if((m==0x00 || m==BW-1 ) && color==BLACK && p==oo[m+16] || - (m==0x70 || m==0x6F+BW) && color==WHITE && p==oo[m-0x70]) - b[m] &= ~32; // corner piece as in original setup: virgin case 0: // undefined piece, ignore break; }