]> git.sesse.net Git - stockfish/blobdiff - src/san.cpp
Unify move generation
[stockfish] / src / san.cpp
index d8e7da15a7f8b7b83931956f7a8d9beb6d432f13..1eb59c32fb17bca173466a764d7e090710ab6ed5 100644 (file)
@@ -149,7 +149,7 @@ Move move_from_san(const Position& pos, const string& movestr) {
   int matches, state = START;
 
   // Generate all legal moves for the given position
-  last = generate_moves(pos, mlist);
+  last = generate<MV_LEGAL>(pos, mlist);
 
   // Castling moves
   if (movestr == "O-O-O" || movestr == "O-O-O+")
@@ -377,7 +377,7 @@ namespace {
         return AMBIGUITY_NONE;
 
     // Collect all legal moves of piece 'pc' with destination 'to'
-    last = generate_moves(pos, mlist);
+    last = generate<MV_LEGAL>(pos, mlist);
     for (MoveStack* cur = mlist; cur != last; cur++)
         if (move_to(cur->move) == to && pos.piece_on(move_from(cur->move)) == pc)
             candidates[matches++] = cur->move;