]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Use update_checkers<>() also for PAWN
[stockfish] / src / position.h
index 4b524ec463e0b1be67a460dc9ee64cef04daf6da..3822e3bc5f225ee276724c9e3347b4e5fb772f19 100644 (file)
@@ -86,8 +86,8 @@ struct UndoInfo {
   Key key, pawnKey, materialKey;
   int rule50;
   Move lastMove;
-  PieceType capture;
   Value mgValue, egValue;
+  PieceType capture;
 };
 
 
@@ -308,6 +308,9 @@ private:
   void undo_ep_move(Move m);
   void find_checkers();
 
+  template<PieceType Piece>
+  void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
+
   template<PieceType Piece, bool FindPinned>
   Bitboard hidden_checks(Color c, Square ksq) const;
 
@@ -529,6 +532,11 @@ inline Bitboard Position::pawn_attacks(Color c, Square s) const {
   return StepAttackBB[pawn_of_color(c)][s];
 }
 
+template<>
+inline Bitboard Position::piece_attacks<PAWN>(Square s) const {
+  return StepAttackBB[pawn_of_color(opposite_color(sideToMove))][s];
+}
+
 template<>
 inline Bitboard Position::piece_attacks<KNIGHT>(Square s) const {
   return StepAttackBB[KNIGHT][s];