]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Fix obey the "maxThreadsPerSplitPoint" setting
[stockfish] / src / movegen.cpp
index 5b8f2e9a8a1103410b740488cf2f88d793c72f25..90d0135a4d0dbe246aa38daa54b94d28820d5ad4 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "bitcount.h"
 #include "movegen.h"
+#include "position.h"
 
 // Simple macro to wrap a very common while loop, no facny, no flexibility,
 // hardcoded list name 'mlist' and from square 'from'.
@@ -151,7 +152,6 @@ namespace {
 template<MoveType Type>
 MoveStack* generate(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(!pos.in_check());
 
   Color us = pos.side_to_move();
@@ -202,7 +202,6 @@ template MoveStack* generate<MV_NON_EVASION>(const Position& pos, MoveStack* mli
 template<>
 MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(!pos.in_check());
 
   Bitboard b, dc;
@@ -213,7 +212,7 @@ MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist)
   assert(pos.piece_on(ksq) == make_piece(opposite_color(us), KING));
 
   // Discovered non-capture checks
-  b = dc = pos.discovered_check_candidates(us);
+  b = dc = pos.discovered_check_candidates();
 
   while (b)
   {
@@ -243,7 +242,6 @@ MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist)
 template<>
 MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
   assert(pos.in_check());
 
   Bitboard b, target;
@@ -315,10 +313,8 @@ MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
 template<>
 MoveStack* generate<MV_LEGAL>(const Position& pos, MoveStack* mlist) {
 
-  assert(pos.is_ok());
-
   MoveStack *last, *cur = mlist;
-  Bitboard pinned = pos.pinned_pieces(pos.side_to_move());
+  Bitboard pinned = pos.pinned_pieces();
 
   last = pos.in_check() ? generate<MV_EVASION>(pos, mlist)
                         : generate<MV_NON_EVASION>(pos, mlist);