]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Fix null move issue
[stockfish] / src / uci.cpp
index 3883b3d370769a9d6469a7fef9b3842f71871c64..d3d99243b0937deb39cb8fae5fee5e3e75e9e160 100644 (file)
@@ -358,15 +358,15 @@ std::string UCI::square(Square s) {
 
 string UCI::move(Move m, bool chess960) {
 
-  Square from = from_sq(m);
-  Square to = to_sq(m);
-
   if (m == MOVE_NONE)
       return "(none)";
 
   if (m == MOVE_NULL)
       return "0000";
 
+  Square from = from_sq(m);
+  Square to = to_sq(m);
+
   if (type_of(m) == CASTLING && !chess960)
       to = make_square(to > from ? FILE_G : FILE_C, rank_of(from));