else
phaseIndex = (noCaptures ? NoMovesPhaseIndex : QsearchWithoutChecksPhaseIndex);
- dc = p.discovered_check_candidates(us);
- pinned = p.pinned_pieces(p.side_to_move());
-
finished = false;
}
if (ttMove != MOVE_NONE)
{
assert(move_is_ok(ttMove));
- if (move_is_legal(pos, ttMove, pinned))
+ if (move_is_legal(pos, ttMove))
return ttMove;
}
break;
if (mateKiller != MOVE_NONE)
{
assert(move_is_ok(mateKiller));
- if (move_is_legal(pos, mateKiller, pinned))
+ if (move_is_legal(pos, mateKiller))
return mateKiller;
}
break;
break;
case PH_BAD_CAPTURES:
- badCapturesPicked = 0;
+ movesPicked = 0;
break;
case PH_NONCAPTURES:
break;
case PH_QCHECKS:
- numOfMoves = generate_checks(pos, moves, dc);
+ numOfMoves = generate_checks(pos, moves);
movesPicked = 0;
break;
moves[bestIndex] = moves[movesPicked++];
if ( move != ttMove
&& move != mateKiller
- && pos.pl_move_is_legal(move, pinned))
+ && pos.pl_move_is_legal(move))
return move;
}
break;
moves[bestIndex] = moves[movesPicked++];
if ( move != ttMove
&& move != mateKiller
- && pos.pl_move_is_legal(move, pinned))
+ && pos.pl_move_is_legal(move))
return move;
}
break;
case PH_BAD_CAPTURES:
assert(!pos.is_check());
- assert(badCapturesPicked >= 0);
+ assert(movesPicked >= 0);
// It's probably a good idea to use SEE move ordering here, instead
// of just picking the first move. FIXME
- while (badCapturesPicked < numOfBadCaptures)
+ while (movesPicked < numOfBadCaptures)
{
- move = badCaptures[badCapturesPicked++].move;
+ move = badCaptures[movesPicked++].move;
if ( move != ttMove
&& move != mateKiller
- && pos.pl_move_is_legal(move, pinned))
+ && pos.pl_move_is_legal(move))
return move;
}
break;
moves[bestIndex] = moves[movesPicked++];
// Remember to change the line below if we decide to hash the qsearch!
// Maybe also postpone the legality check until after futility pruning?
- if (/* move != ttMove && */ pos.pl_move_is_legal(move, pinned))
+ if (/* move != ttMove && */ pos.pl_move_is_legal(move))
return move;
}
break;
{
move = moves[movesPicked++].move;
// Remember to change the line below if we decide to hash the qsearch!
- if (/* move != ttMove && */ pos.pl_move_is_legal(move, pinned))
+ if (/* move != ttMove && */ pos.pl_move_is_legal(move))
return move;
}
break;