]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Rename move_is_legal() in move_is_pl()
[stockfish] / src / movegen.cpp
index 64c6ac50135d83ea121d1b950c315578cb629ef3..297b51ffdeacb7e6d633be647d9e3da3a89ffc49 100644 (file)
@@ -151,7 +151,7 @@ template<MoveType Type>
 MoveStack* generate(const Position& pos, MoveStack* mlist) {
 
   assert(pos.is_ok());
-  assert(!pos.is_check());
+  assert(!pos.in_check());
 
   Color us = pos.side_to_move();
   Bitboard target;
@@ -202,7 +202,7 @@ template<>
 MoveStack* generate<MV_NON_CAPTURE_CHECK>(const Position& pos, MoveStack* mlist) {
 
   assert(pos.is_ok());
-  assert(!pos.is_check());
+  assert(!pos.in_check());
 
   Bitboard b, dc;
   Square from;
@@ -243,7 +243,7 @@ template<>
 MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
 
   assert(pos.is_ok());
-  assert(pos.is_check());
+  assert(pos.in_check());
 
   Bitboard b, target;
   Square from, checksq;
@@ -311,7 +311,7 @@ MoveStack* generate<MV_PSEUDO_LEGAL>(const Position& pos, MoveStack* mlist) {
 
   assert(pos.is_ok());
 
-  return pos.is_check() ? generate<MV_EVASION>(pos, mlist)
+  return pos.in_check() ? generate<MV_EVASION>(pos, mlist)
                         : generate<MV_NON_EVASION>(pos, mlist);
 }
 
@@ -451,7 +451,7 @@ namespace {
     // Single and double pawn pushes
     if (Type != MV_CAPTURE)
     {
-        b1 = pawnPushes & emptySquares;
+        b1 = (Type != MV_EVASION ? pawnPushes : pawnPushes & emptySquares);
         b2 = move_pawns<TDELTA_N>(pawnPushes & TRank3BB) & emptySquares;
 
         if (Type == MV_CHECK)