added check if loading tape file fails when auto-processing tapes
authorHolger Schemel <info@artsoft.org>
Sat, 3 Jul 2021 11:31:08 +0000 (13:31 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 3 Jul 2021 11:31:08 +0000 (13:31 +0200)
src/tape.c

index 2ff74646926adb9d8ee5f1bedb3d29f51d68a7cf..82792fe116b922a4cd1f30062c38129dedfe1547 100644 (file)
@@ -1425,6 +1425,14 @@ void AutoPlayTapes(void)
 
       LoadTapeFromFilename(tape_filename);
 
+      if (tape.no_valid_file)
+      {
+       if (!fileExists(tape_filename))
+         Fail("tape file '%s' does not exist", tape_filename);
+       else
+         Fail("cannot load tape file '%s'", tape_filename);
+      }
+
       global.autoplay_leveldir = tape.level_identifier;
 
       if (tape.level_nr >= 0 && tape.level_nr < MAX_TAPES_PER_SET)