]> git.sesse.net Git - stockfish/blobdiff - src/history.h
Do not send ponder move if we don't have it
[stockfish] / src / history.h
index c01893321dd63a33cd9aa4abfa0e1804caa7de2e..c265777b42a6c4d0bcf60485aae9d80a64625f43 100644 (file)
 #define HISTORY_H_INCLUDED
 
 #include <cstring>
-
-#include "depth.h"
-#include "piece.h"
-#include "square.h"
-#include "value.h"
-
+#include "types.h"
 
 /// The History class stores statistics about how often different moves
 /// have been successful or unsuccessful during the current search. These
@@ -38,7 +33,6 @@
 class History {
 
 public:
-  History() { clear(); }
   void clear();
   Value value(Piece p, Square to) const;
   void update(Piece p, Square to, Value bonus);
@@ -62,7 +56,7 @@ inline Value History::value(Piece p, Square to) const {
 }
 
 inline void History::update(Piece p, Square to, Value bonus) {
-  if (abs(history[p][to]) < MaxValue) history[p][to] += bonus;
+  if (abs(history[p][to] + bonus) < MaxValue) history[p][to] += bonus;
 }
 
 inline Value History::gain(Piece p, Square to) const {