]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Update killers after a TT hit
[stockfish] / src / position.h
index 431d059c7efb2570305b752807dc10ac60c2266e..695ad98db8d9bf157effd8be06bc695effa4477a 100644 (file)
@@ -48,10 +48,10 @@ class Position;
 
 struct StateInfo {
   Key pawnKey, materialKey;
-  int castleRights, rule50, gamePly, pliesFromNull;
-  Square epSquare;
-  Score value;
   Value npMaterial[2];
+  int castleRights, rule50, pliesFromNull;
+  Score value;
+  Square epSquare;
 
   Key key;
   Bitboard checkersBB;
@@ -163,7 +163,6 @@ public:
   bool pawn_is_passed(Color c, Square s) const;
 
   // Doing and undoing moves
-  void do_setup_move(Move m, StateInfo& st);
   void do_move(Move m, StateInfo& st);
   void do_move(Move m, StateInfo& st, const CheckInfo& ci, bool moveIsCheck);
   void undo_move(Move m);
@@ -189,7 +188,7 @@ public:
   bool is_mate() const;
   template<bool SkipRepetition> bool is_draw() const;
 
-  // Number of plies from starting position
+  // Plies from start position to the beginning of search
   int startpos_ply_counter() const;
 
   // Other properties of the position
@@ -256,8 +255,8 @@ private:
   Square castleRookSquare[16]; // [castleRight]
   StateInfo startState;
   int64_t nodes;
+  int startPosPly;
   Color sideToMove;
-  int fullMoves;
   int threadID;
   StateInfo* st;
   int chess960;
@@ -424,7 +423,7 @@ inline bool Position::move_is_passed_pawn_push(Move m) const {
 }
 
 inline int Position::startpos_ply_counter() const {
-  return Max(2 * (fullMoves - 1), 0) + int(sideToMove == BLACK);
+  return startPosPly + st->pliesFromNull; // HACK
 }
 
 inline bool Position::opposite_colored_bishops() const {