mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Only migrate savedata if "saves" was created
This commit is contained in:
parent
bc0b9e1fa0
commit
fcb09f85cb
1 changed files with 5 additions and 5 deletions
|
@ -55,7 +55,7 @@ static const PHYSFS_Allocator allocator = {
|
|||
int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
||||
{
|
||||
char output[MAX_PATH];
|
||||
int mkdirResult;
|
||||
int saveDirCreated;
|
||||
int retval;
|
||||
const char* pathSep = PHYSFS_getDirSeparator();
|
||||
char* basePath;
|
||||
|
@ -81,7 +81,7 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
|||
}
|
||||
|
||||
/* Create base user directory, mount */
|
||||
mkdirResult = PHYSFS_mkdir(output);
|
||||
PHYSFS_mkdir(output);
|
||||
|
||||
/* Mount our base user directory */
|
||||
PHYSFS_mount(output, NULL, 0);
|
||||
|
@ -89,8 +89,8 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
|||
printf("Base directory: %s\n", output);
|
||||
|
||||
/* Create the save/level folders */
|
||||
mkdirResult |= PHYSFS_mkdir("saves");
|
||||
mkdirResult |= PHYSFS_mkdir("levels");
|
||||
saveDirCreated = PHYSFS_mkdir("saves");
|
||||
PHYSFS_mkdir("levels");
|
||||
|
||||
/* Store full save directory */
|
||||
SDL_snprintf(saveDir, sizeof(saveDir), "%s%s%s",
|
||||
|
@ -109,7 +109,7 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath)
|
|||
printf("Level directory: %s\n", levelDir);
|
||||
|
||||
/* We didn't exist until now, migrate files! */
|
||||
if (mkdirResult == 0)
|
||||
if (saveDirCreated != 0)
|
||||
{
|
||||
PLATFORM_migrateSaveData(output);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue