+ while (movesPicked < numOfMoves)
+ {
+ Move move = moves[movesPicked++].move;
+ if ( move != ttMove
+ && move != mateKiller
+ && pos.pl_move_is_legal(move, pinned))
+ {
+ // Check for a non negative SEE now
+ int seeValue = pos.see_sign(move);
+ if (seeValue >= 0)
+ return move;
+
+ // Losing capture, move it to the badCaptures[] array, note
+ // that move has now been already checked for legality.
+ assert(numOfBadCaptures < 63);
+ badCaptures[numOfBadCaptures].move = move;
+ badCaptures[numOfBadCaptures++].score = seeValue;
+ }
+ }
+ break;