From: Holger Schemel Date: Sat, 16 Oct 2021 17:10:04 +0000 (+0200) Subject: removed using level number sub-directories when saving score tapes X-Git-Tag: 4.3.0.0~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=94045da2221fcef6b3c1cc12db1eaf3ae35c73b7;p=rocksndiamonds.git removed using level number sub-directories when saving score tapes --- diff --git a/src/files.c b/src/files.c index fab3df37..78a505dd 100644 --- a/src/files.c +++ b/src/files.c @@ -8401,7 +8401,7 @@ void SaveScoreTape(int nr) char *filename = getScoreTapeFilename(tape.score_tape_basename, nr); // used instead of "leveldir_current->subdir" (for network games) - InitScoreTapeDirectory(levelset.identifier, nr); + InitScoreDirectory(levelset.identifier); SaveTapeExt(filename); } diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 0a406540..129be747 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -140,19 +140,6 @@ static char *getScoreCacheDir(char *level_subdir) return score_dir; } -static char *getScoreTapeDir(char *level_subdir, int nr) -{ - static char *score_tape_dir = NULL; - char tape_subdir[MAX_FILENAME_LEN]; - - checked_free(score_tape_dir); - - sprintf(tape_subdir, "%03d", nr); - score_tape_dir = getPath2(getScoreDir(level_subdir), tape_subdir); - - return score_tape_dir; -} - static char *getUserSubdir(int nr) { static char user_subdir[16] = { 0 }; @@ -686,10 +673,10 @@ char *getScoreTapeFilename(char *basename_no_ext, int nr) checked_free(filename); - sprintf(basename, "%s.%s", basename_no_ext, TAPEFILE_EXTENSION); + sprintf(basename, "%03d.%s.%s", nr, basename_no_ext, TAPEFILE_EXTENSION); // used instead of "leveldir_current->subdir" (for network games) - filename = getPath2(getScoreTapeDir(levelset.identifier, nr), basename); + filename = getPath2(getScoreDir(levelset.identifier), basename); return filename; } @@ -1177,13 +1164,6 @@ void InitScoreCacheDirectory(char *level_subdir) createDirectory(getScoreCacheDir(level_subdir), "level score", PERMS_PRIVATE); } -void InitScoreTapeDirectory(char *level_subdir, int nr) -{ - InitScoreDirectory(level_subdir); - - createDirectory(getScoreTapeDir(level_subdir, nr), "score tape", PERMS_PRIVATE); -} - static void SaveUserLevelInfo(void); void InitUserLevelDirectory(char *level_subdir) diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 68f67a78..194dea7e 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -291,7 +291,6 @@ char *getCustomMusicDirectory(void); void InitTapeDirectory(char *); void InitScoreDirectory(char *); void InitScoreCacheDirectory(char *); -void InitScoreTapeDirectory(char *, int); void InitUserLevelDirectory(char *); void InitNetworkLevelDirectory(char *); void InitLevelSetupDirectory(char *);