From: H.G.Muller Date: Tue, 10 Apr 2018 15:59:51 +0000 (+0200) Subject: Allow entire board to be promotion zone X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=81c4a53cc4cf764cf8aaaabccb2391c5a419d655;p=crazywa.git Allow entire board to be promotion zone The test for determining whether a drop on first or last rank is actually a drop on first rank (so it would not be subject to restrictions in Shogi) was not working if the entire board was the promotion zone, as it was based on being outside the zone for the applicable color. A test directly based on the square number ow fixes that. --- diff --git a/dropper.c b/dropper.c index 74e0ea8..9685e96 100644 --- a/dropper.c +++ b/dropper.c @@ -930,7 +930,7 @@ EvasionDrops (int stm, StackFrame *f, int mask) if((mask >>= 1) & 1) continue; // suppress 'futile interpositions' i = zoneTab[x] & Z_LAST; // Pawn not on first & last rank (OK for zh) if(perpLoses) { // but it is Shogi! - if(!(zoneTab[x] & stm)) i = 0; // outside zone, so dropping is always allowed + if(x<22 ^ stm==BLACK) i = 0; // pawn drops allowed on 1st rank for white and elsewhere for black else if(perpLoses < TORI_NR) { // Shogi variant with Lance i *= 2; // no Pawn, then also no Lance! last -= (zoneTab[x] & (Z_2ND & ~COLOR)) > knightLim; // on last 2 ranks trim off Knight (not in Wa)