int searchTT = ttm;
ttMoves[0].move = ttm;
badCaptureThreshold = 0;
- badCaptures = moves + MOVES_MAX;
+ badCaptures = moves + MAX_MOVES;
assert(d > DEPTH_ZERO);
pinned = p.pinned_pieces(pos.side_to_move());
- if (p.is_check())
+ if (p.in_check())
{
ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
phasePtr = EvasionTable;
pinned = p.pinned_pieces(pos.side_to_move());
- if (p.is_check())
+ if (p.in_check())
phasePtr = EvasionTable;
else if (d >= DEPTH_QS_CHECKS)
phasePtr = QsearchWithChecksTable;
// Bad captures SEE value is already calculated so just pick
// them in order to get SEE move ordering.
curMove = badCaptures;
- lastMove = moves + MOVES_MAX;
+ lastMove = moves + MAX_MOVES;
return;
case PH_EVASIONS:
- assert(pos.is_check());
+ assert(pos.in_check());
lastMove = generate<MV_EVASION>(pos, moves);
score_evasions();
return;
}
void MovePicker::score_noncaptures() {
- // Score by history and max gain for the move.
+
Move m;
- Piece piece;
- Square from, to;
+ Square from;
for (MoveStack* cur = moves; cur != lastMove; cur++)
{
m = cur->move;
from = move_from(m);
- to = move_to(m);
- piece = pos.piece_on(from);
- cur->score = H.value(piece, to) + H.gain(piece, to);
+ cur->score = H.value(pos.piece_on(from), move_to(m));
}
}