added extreme speedup in case of missing tapes when auto-testing
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 5 Oct 2021 16:06:15 +0000 (18:06 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 5 Oct 2021 16:06:15 +0000 (18:06 +0200)
This uses the same tape check to speed things up in case of missing
tapes that was already used for uploading tapes in commit e11fa67d.

src/tape.c

index f5d78c6a8cb14e5e2710780501538b73e35445af..92d24473e254224f66cad929b12fdf5d72f391a1 100644 (file)
@@ -1696,17 +1696,18 @@ static int AutoPlayTapesExt(boolean initialize)
     if (!global.autoplay_all && !global.autoplay_level[level_nr])
       continue;
 
-    if (global.autoplay_mode == AUTOPLAY_MODE_UPLOAD)
+    char *tape_filename = (autoplay.tape_filename ? autoplay.tape_filename :
+                           options.mytapes ? getTapeFilename(level_nr) :
+                           getSolutionTapeFilename(level_nr));
+
+    // speed things up in case of missing tapes (by skipping loading level)
+    if (!fileExists(tape_filename))
     {
-      // speed things up when uploading all existing private tapes
-      if (autoplay.all_levelsets && !fileExists(getTapeFilename(level_nr)))
-      {
-       autoplay.num_tape_missing++;
+      autoplay.num_tape_missing++;
 
-       Print("Tape %03d: (no tape found)\n", level_nr);
+      Print("Tape %03d: (no tape found)\n", level_nr);
 
-       continue;
-      }
+      continue;
     }
 
     TapeErase();
@@ -1738,7 +1739,7 @@ static int AutoPlayTapesExt(boolean initialize)
     {
       autoplay.num_tape_missing++;
 
-      Print("Tape %03d: (no tape found)\n", level_nr);
+      Print("Tape %03d: (invalid tape)\n", level_nr);
 
       continue;
     }