The wrap-around when we run past white King should not be done in
toggle mode, where it is guaranteed we won't run out of range.
if(step && !(toggleFlag && Partner(&promoSweep))) promoSweep -= step;
if(promoSweep == EmptySquare) promoSweep = BlackPawn; // wrap
else if((int)promoSweep == -1) promoSweep = WhiteKing;
- else if(promoSweep == BlackPawn && step < 0) promoSweep = WhitePawn;
- else if(promoSweep == WhiteKing && step > 0) promoSweep = BlackKing;
+ else if(promoSweep == BlackPawn && step < 0 && !toggleFlag) promoSweep = WhitePawn;
+ else if(promoSweep == WhiteKing && step > 0 && !toggleFlag) promoSweep = BlackKing;
if(!step) step = -1;
} while(PieceToChar(promoSweep) == '.' || PieceToChar(promoSweep) == '~' || promoSweep == pawn ||
!toggleFlag && PieceToChar(promoSweep) == '+' || // skip promoted versions of other