CheckDrops() tested half-way the iteration whether it should also try
dropping the unpromoted piece, based on the assumption that we must do
the Pawn iteration for dropping +P, even if dropping P is forbidden.
But in games where +P can be dropped, dropping P (in a place where it
checks) can never be forbidden!
{
int i, lowest = 0;
if(perpLoses) lowest = !!(pawnCount[sqr2file[king]] & maxBulk[stm]); // in Shogi no Pawn if file already crowded with those
- else lowest = (stm == WHITE ? king < 2*22 : king >= 6*22); // in zh no Pawn from back rank
- for(i=maxDrop; i>=0; i--) {
+ else lowest = (stm == WHITE ? king < 2*22 : king >= 6*22); // in zh no Pawn from back rank
+ for(i=maxDrop; i>=lowest; i--) { // note: in games with promoDrops lowest=0 as Pawns have no bulk there
int piece = stm + i, from = handSlot[piece^COLOR];
if((signed char)board[from] < -1) { // piece type is in hand
int step, dir;
}
}
}
- if(i < lowest) break; // suppresses back-rank Pawn drops in zh
dir = 2*firstDir[piece-WHITE];
while((step = steps[dir++])) {
int to = king, range = steps[dir++];