From: Holger Schemel Date: Mon, 23 Aug 2021 10:25:57 +0000 (+0200) Subject: added saving non-standard solution tape to temporary file before uploading X-Git-Tag: 4.3.0.0~88 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=329e47f3131d6d3cad97adff27db207c906f5f20 added saving non-standard solution tape to temporary file before uploading --- diff --git a/src/tape.c b/src/tape.c index 3d6774dd..21a5945b 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1629,18 +1629,35 @@ void AutoPlayTapes(void) if (global.autoplay_mode == AUTOPLAY_MODE_UPLOAD) { + boolean use_temporary_tape_file = FALSE; + Print("Tape %03d:\n", level_nr); AutoPlayTapes_SetScoreEntry(0, 0); if (tape_filename == NULL) + { tape_filename = (options.mytapes ? getTapeFilename(level_nr) : - getSolutionTapeFilename(level_nr)); + getDefaultSolutionTapeFilename(level_nr)); + + if (!fileExists(tape_filename)) + { + // non-standard solution tape -- save to temporary file + tape_filename = getTemporaryTapeFilename(); + + SaveTapeToFilename(tape_filename); + + use_temporary_tape_file = TRUE; + } + } SaveServerScoreFromFile(level_nr, tape_filename); AutoPlayTapes_WaitForUpload(); + if (use_temporary_tape_file) + unlink(tape_filename); + // required for uploading multiple tapes tape_filename = NULL;