{\r
if(board[y] != EMPTY) return 1; // edge, capture or own piece\r
//if(flag) printf("# add %c%d%c%d, pf=%d\n", x%BW+'a',x/BW,y%BW+'a',y/BW, promoFlags);\r
- if( (promoBoard[x] | promoBoard[y]) & promoFlags &&\r
- (!entryProm || promoBoard[y] & ~promoBoard[x] & CAN_PROMOTE )){ // piece can promote with this move\r
+ if( (entryProm ? promoBoard[y] & ~promoBoard[x] & CAN_PROMOTE\r
+ : promoBoard[y] | promoBoard[x] ) & promoFlags ){ // piece can promote with this move\r
moveStack[msp++] = moveStack[nonCapts]; // create space for promotion\r
moveStack[nonCapts++] = x<<SQLEN | y | PROMOTE; // push promotion\r
if((promoFlags & promoBoard[y] & (CANT_DEFER | DONT_DEFER | LAST_RANK)) == 0) { // deferral could be a better alternative\r