mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
removed some unused save directories and abort when the save directory cannot be created
This commit is contained in:
parent
cc90329689
commit
5fdca5bf54
|
@ -52,7 +52,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// add save directories
|
// add save directories
|
||||||
if(StorageType != STORAGETYPE_BASIC && m_NumPaths && (!m_aaStoragePaths[TYPE_SAVE][0] || !fs_makedir(m_aaStoragePaths[TYPE_SAVE])))
|
if(StorageType != STORAGETYPE_BASIC)
|
||||||
|
{
|
||||||
|
if(m_NumPaths && (!m_aaStoragePaths[TYPE_SAVE][0] || !fs_makedir(m_aaStoragePaths[TYPE_SAVE])))
|
||||||
{
|
{
|
||||||
char aPath[MAX_PATH_LENGTH];
|
char aPath[MAX_PATH_LENGTH];
|
||||||
if(StorageType == STORAGETYPE_CLIENT)
|
if(StorageType == STORAGETYPE_CLIENT)
|
||||||
|
@ -62,17 +64,17 @@ public:
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath)));
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath)));
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "skins", aPath, sizeof(aPath)));
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/bodies", aPath, sizeof(aPath)));
|
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/decoration", aPath, sizeof(aPath)));
|
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/eyes", aPath, sizeof(aPath)));
|
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/feet", aPath, sizeof(aPath)));
|
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/hands", aPath, sizeof(aPath)));
|
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "skins/tattoos", aPath, sizeof(aPath)));
|
|
||||||
}
|
}
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "dumps", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "dumps", aPath, sizeof(aPath)));
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath)));
|
||||||
fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath)));
|
fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath)));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbg_msg("storage", "unable to create save directory");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return m_NumPaths ? 0 : 1;
|
return m_NumPaths ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue