(svn r15610) -Change: allow loading of heightmaps and savegames (any form) that are in .tar files

This commit is contained in:
rubidium
2009-03-04 09:53:31 +00:00
parent ceea4927df
commit a6ca7b8237
5 changed files with 19 additions and 19 deletions

View File

@@ -358,7 +358,7 @@ FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir,
}
/* We can only use .tar in case of data-dir, and read-mode */
if (f == NULL && (subdir == DATA_DIR || subdir == AI_DIR || subdir == AI_LIBRARY_DIR) && mode[0] == 'r') {
if (f == NULL && mode[0] == 'r') {
static const uint MAX_RESOLVED_LENGTH = 2 * (100 + 100 + 155) + 1; // Enough space to hold two filenames plus link. See 'TarHeader'.
char resolved_name[MAX_RESOLVED_LENGTH];
@@ -777,6 +777,8 @@ void ScanForTarFiles()
num += ScanPathForTarFiles(path, strlen(path));
FioAppendDirectory(path, MAX_PATH, sp, AI_LIBRARY_DIR);
num += ScanPathForTarFiles(path, strlen(path));
FioAppendDirectory(path, MAX_PATH, sp, SCENARIO_DIR);
num += ScanPathForTarFiles(path, strlen(path));
}
DEBUG(misc, 1, "Scan complete, found %d files", num);
}