removed using level number sub-directories when saving score tapes
authorHolger Schemel <info@artsoft.org>
Sat, 16 Oct 2021 17:10:04 +0000 (19:10 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 16 Oct 2021 17:11:04 +0000 (19:11 +0200)
src/files.c
src/libgame/setup.c
src/libgame/setup.h

index fab3df37653d139a61b68d0b52aa39e09c306e5a..78a505dd4c4699469a0b636b629dc4f26e097e73 100644 (file)
@@ -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);
 }
index 0a406540224696e012e1243fe9944407a62a4863..129be747af2f74255697c6e5d804fca741543160 100644 (file)
@@ -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)
index 68f67a7825b06360ec610cbf6ff0e0f6c10c2e74..194dea7ebeb0c8fa99e55bc2f25b7ad7ec2614af 100644 (file)
@@ -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 *);