From: H.G.Muller Date: Thu, 9 Oct 2025 14:04:00 +0000 (+0200) Subject: Fix last-rank Pawn promotion X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=195a7bf5f5a9cad6d1908fa3aabc9ca62792e271;p=hachu.git Fix last-rank Pawn promotion With "Promote on entry" on, Pawns were not allowed to promote on last rank in Chu Shogi. Undesired side effect of this fix is that Lances now also are allowed to do that (subject to a 1-turn delay). --- diff --git a/hachu.c b/hachu.c index a244701..34f61c5 100644 --- a/hachu.c +++ b/hachu.c @@ -1203,8 +1203,9 @@ inline int NewNonCapture (int x, int y, int promoFlags) { if(board[y] != EMPTY) return 1; // edge, capture or own piece -//if(flag) printf("# add %c%d%c%d, pf=%d\n", x%BW+'a',x/BW,y%BW+'a',y/BW, promoFlags); - if( (entryProm ? promoBoard[y] & ~promoBoard[x] & CAN_PROMOTE +//if(flag) +printf("# add %c%d%c%d, pf=%x %x %x\n", x%BW+'a',x/BW+1,y%BW+'a',y/BW+1, promoFlags, promoBoard[x], promoBoard[y]); + if( (entryProm ? promoBoard[y] & (~promoBoard[x] & CAN_PROMOTE | LAST_RANK) : promoBoard[y] | promoBoard[x] ) & promoFlags ){ // piece can promote with this move moveStack[msp++] = moveStack[nonCapts]; // create space for promotion moveStack[nonCapts++] = x<