After Lucas patch it is almost useless.
No functional change.
/// to a StateInfo object. The move is assumed to be legal. Pseudo-legal
/// moves should be filtered out before this function is called.
-void Position::do_move(Move m, StateInfo& newSt) {
-
- CheckInfo ci(*this);
- do_move(m, newSt, gives_check(m, ci));
-}
-
void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
assert(is_ok(m));
// Update the key with the final value
st->key = k;
- // Calculate checkers bitboard (if move is check)
+ // Calculate checkers bitboard (if move gives check)
st->checkersBB = givesCheck ? attackers_to(king_square(them)) & pieces(us) : 0;
sideToMove = ~sideToMove;
bool opposite_bishops() const;
// Doing and undoing moves
- void do_move(Move m, StateInfo& st);
void do_move(Move m, StateInfo& st, bool givesCheck);
void undo_move(Move m);
void do_null_move(StateInfo& st);
if (!ttHit || tte->move() != m) // Don't overwrite correct entries
tte->save(pos.key(), VALUE_NONE, BOUND_NONE, DEPTH_NONE, m, VALUE_NONE, TT.generation());
- pos.do_move(m, *st++);
+ pos.do_move(m, *st++, pos.gives_check(m, CheckInfo(pos)));
}
for (size_t i = pv.size(); i > 0; )
assert(pv.size() == 1);
- pos.do_move(pv[0], st);
+ pos.do_move(pv[0], st, pos.gives_check(pv[0], CheckInfo(pos)));
TTEntry* tte = TT.probe(pos.key(), ttHit);
pos.undo_move(pv[0]);
while (is >> token && (m = UCI::to_move(pos, token)) != MOVE_NONE)
{
SetupStates->push(StateInfo());
- pos.do_move(m, SetupStates->top());
+ pos.do_move(m, SetupStates->top(), pos.gives_check(m, CheckInfo(pos)));
}
}