X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=7725b934e1eb34824789ae7cbdeaf54078ab53fb;hp=0a275b5ee3bdc4e7dfb48fe3b8e8d2f835cced48;hb=55f9afee2a079b2dd0b1aeda41082c58eb317ca3;hpb=962216440c186d067d8946112acab847ccb7249f diff --git a/src/position.cpp b/src/position.cpp index 0a275b5e..7725b934 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1662,6 +1662,18 @@ int Position::see(Square from, Square to) const { } +/// Position::setStartState() copies the content of the argument +/// inside startState and makes st point to it. This is needed +/// when the st pointee could become stale, as example because +/// the caller is about to going out of scope. + +void Position::setStartState(const StateInfo& s) { + + startState = s; + st = &startState; +} + + /// Position::clear() erases the position object to a pristine state, with an /// empty board, white to move, and no castling rights.