Commits

billforsternz  committed 70d730c

Fix play game against engine after NULL move bug

  • Participants
  • Parent commits 1a0960f

Comments (0)

Files changed (1)

File src/GameLogic.cpp

             }
             okay_to_use_move_list = true;
             cr.PlayMove( move );
+            if( saving_moves && move.src==move.dst ) // If NULL move encountered, start again after NULL move played
+            {                                        //  [Minimum V2.02 bug fix note: surrounding code is ugly and should
+                                                     //    be improved, eg okay_to_move_list does nothing in the loop ]
+                move_list_startpos = cr;
+                smoves = "";
+            }
         }
         if( okay_to_use_move_list )
         {
         }
         okay_to_use_move_list = true;
         cr.PlayMove( move );
+        if( saving_moves && move.src==move.dst ) // If NULL move encountered, start again after NULL move played
+        {                                        //  [Minimum V2.02 bug fix note: surrounding code is ugly and should
+                                                 //    be improved, eg okay_to_move_list does nothing in the loop ]
+            move_list_startpos = cr;
+            smoves = "";
+        }
     }
     if( okay_to_use_move_list )
     {