removed some unused save directories and abort when the save directory cannot be created

This commit is contained in:
oy 2012-07-19 11:49:03 +02:00
parent cc90329689
commit 5fdca5bf54

View file

@ -52,26 +52,28 @@ 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)
{ {
char aPath[MAX_PATH_LENGTH]; if(m_NumPaths && (!m_aaStoragePaths[TYPE_SAVE][0] || !fs_makedir(m_aaStoragePaths[TYPE_SAVE])))
if(StorageType == STORAGETYPE_CLIENT)
{ {
fs_makedir(GetPath(TYPE_SAVE, "screenshots", aPath, sizeof(aPath))); char aPath[MAX_PATH_LENGTH];
fs_makedir(GetPath(TYPE_SAVE, "screenshots/auto", aPath, sizeof(aPath))); if(StorageType == STORAGETYPE_CLIENT)
fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath))); {
fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "screenshots", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "skins", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "screenshots/auto", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "skins/bodies", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "maps", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "skins/decoration", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "downloadedmaps", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "skins/eyes", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "skins", 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, "dumps", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "skins/tattoos", aPath, sizeof(aPath))); fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath)));
}
else
{
dbg_msg("storage", "unable to create save directory");
return 1;
} }
fs_makedir(GetPath(TYPE_SAVE, "dumps", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "demos", aPath, sizeof(aPath)));
fs_makedir(GetPath(TYPE_SAVE, "demos/auto", aPath, sizeof(aPath)));
} }
return m_NumPaths ? 0 : 1; return m_NumPaths ? 0 : 1;