char s[MAX_DATETIME_STRING_SIZE];
int year2 = value / 10000;
int year4 = (year2 < 70 ? 2000 + year2 : 1900 + year2);
- int month_index = (value / 100) % 100;
+ int month_index_raw = (value / 100) % 100;
+ int month_index = month_index_raw % 12; // prevent invalid index
int month = month_index + 1;
int day = value % 100;
server_scores.uploaded = FALSE;
- // temporarily save score tape (as the tape filename is unknown here)
+ // save score tape to upload to server; may be required for some reasons:
+ // * level set identifier in solution tapes may differ from level set
+ // * solution tape may have native format (like Supaplex solution files)
+
SaveScoreTape(level_nr);
SaveServerScore(level_nr);
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)