summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9b257ba)
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
assert(!is_check());
// Back up the information necessary to undo the null move to the supplied
assert(!is_check());
// Back up the information necessary to undo the null move to the supplied
- // UndoInfo object. In the case of a null move, the only thing we need to
+ // UndoInfo object. In the case of a null move, the only thing we need to
// remember is the last move made and the en passant square.
u.lastMove = lastMove;
u.epSquare = epSquare;
// remember is the last move made and the en passant square.
u.lastMove = lastMove;
u.epSquare = epSquare;
+ u.previous = previous;
+ previous = &u;
// Save the current key to the history[] array, in order to be able to
// detect repetition draws.
// Save the current key to the history[] array, in order to be able to
// detect repetition draws.
/// Position::undo_null_move() unmakes a "null move".
/// Position::undo_null_move() unmakes a "null move".
-void Position::undo_null_move(const UndoInfo &u) {
+void Position::undo_null_move() {
assert(is_ok());
assert(!is_check());
assert(is_ok());
assert(!is_check());
- // Restore information from the supplied UndoInfo object:
- lastMove = u.lastMove;
- epSquare = u.epSquare;
+ // Restore information from the our UndoInfo object
+ lastMove = previous->lastMove;
+ epSquare = previous->epSquare;
+ previous = previous->previous;
+
if (epSquare != SQ_NONE)
key ^= zobEp[epSquare];
if (epSquare != SQ_NONE)
key ^= zobEp[epSquare];
- // Update the necessary information.
+ // Update the necessary information
sideToMove = opposite_color(sideToMove);
rule50--;
gamePly--;
sideToMove = opposite_color(sideToMove);
rule50--;
gamePly--;
// Undo null move, if necessary
if (c != stm)
// Undo null move, if necessary
if (c != stm)
void do_move(Move m, UndoInfo &u);
void undo_move(Move m);
void do_null_move(UndoInfo &u);
void do_move(Move m, UndoInfo &u);
void undo_move(Move m);
void do_null_move(UndoInfo &u);
- void undo_null_move(const UndoInfo &u);
// Static exchange evaluation
int see(Square from, Square to) const;
// Static exchange evaluation
int see(Square from, Square to) const;
&& pos.see(ss[ply + 1].currentMove) + nullValue >= beta)
nullDrivenIID = true;
&& pos.see(ss[ply + 1].currentMove) + nullValue >= beta)
nullDrivenIID = true;
if (value_is_mate(nullValue))
{
if (value_is_mate(nullValue))
{