]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Avoid copy a Position to get a move's san notation
[stockfish] / src / position.cpp
index 2b6e2b4c07a5e84640d839cd6aca37b77abf9f6d..a389e9c05a6e77d3892ae240b644a3ee730062e7 100644 (file)
@@ -356,8 +356,9 @@ void Position::print(Move m) const {
   std::cout << std::endl;
   if (m != MOVE_NONE)
   {
+      Position p(*this);
       string col = (color_of_piece_on(move_from(m)) == BLACK ? ".." : "");
-      std::cout << "Move is: " << col << move_to_san(*this, m) << std::endl;
+      std::cout << "Move is: " << col << move_to_san(p, m) << std::endl;
   }
   for (Rank rank = RANK_8; rank >= RANK_1; rank--)
   {