char *filename = getScoreTapeFilename(tape.score_tape_basename, nr);
// used instead of "leveldir_current->subdir" (for network games)
- InitScoreDirectory(levelset.identifier);
+ InitScoreTapeDirectory(levelset.identifier, nr);
SaveTapeExt(filename);
}
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 };
checked_free(filename);
- sprintf(basename, "%03d.%s.%s", nr, basename_no_ext, TAPEFILE_EXTENSION);
+ sprintf(basename, "%s.%s", basename_no_ext, TAPEFILE_EXTENSION);
// used instead of "leveldir_current->subdir" (for network games)
- filename = getPath2(getScoreDir(levelset.identifier), basename);
+ filename = getPath2(getScoreTapeDir(levelset.identifier, nr), basename);
return filename;
}
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)
void InitTapeDirectory(char *);
void InitScoreDirectory(char *);
void InitScoreCacheDirectory(char *);
+void InitScoreTapeDirectory(char *, int);
void InitUserLevelDirectory(char *);
void InitNetworkLevelDirectory(char *);
void InitLevelSetupDirectory(char *);