Fixed: Create Ryzom profile folder if not already created and return 1 if unable to create it

This commit is contained in:
kervala 2016-05-29 20:36:53 +02:00
parent 935cb89290
commit 31c3e663a8

View file

@ -203,13 +203,18 @@ int main(int argc, char **argv)
{
std::string currentPath = CPath::getApplicationDirectory("Ryzom");
// append profile ID to directory
if (Args.haveArg("p"))
currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("p").front();
// create parent directory
if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath);
CPath::setCurrentPath(currentPath);
// append profile ID to directory
if (Args.haveArg("p"))
{
currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("p").front();
if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath);
}
if (!CPath::setCurrentPath(currentPath)) return 1;
}
#ifdef TEST_CRASH_COUNTER