wallOrMove bug fix (#763)
authorRainRat <rainrat78@yahoo.ca>
Wed, 17 Apr 2024 15:11:50 +0000 (08:11 -0700)
committerGitHub <noreply@github.com>
Wed, 17 Apr 2024 15:11:50 +0000 (17:11 +0200)
src/position.cpp

index ade4798..b9f34be 100644 (file)
@@ -1558,7 +1558,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
   Piece captured = piece_on(type_of(m) == EN_PASSANT ? capture_square(to) : to);
   if (to == from)
   {
-      assert((type_of(m) == PROMOTION && sittuyin_promotion()) || (is_pass(m) && pass(us)));
+      assert((type_of(m) == PROMOTION && sittuyin_promotion()) || (is_pass(m) && (pass(us) || var->wallOrMove )));
       captured = NO_PIECE;
   }
   st->capturedpromoted = is_promoted(to);
@@ -2128,7 +2128,7 @@ void Position::undo_move(Move m) {
 
   assert(type_of(m) == DROP || empty(from) || type_of(m) == CASTLING || is_gating(m)
          || (type_of(m) == PROMOTION && sittuyin_promotion())
-         || (is_pass(m) && pass(us)));
+         || (is_pass(m) && (pass(us) || var->wallOrMove)));
   assert(type_of(st->capturedPiece) != KING);
 
   // Reset wall squares