diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index dcce43cc0..f2eaf64c0 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -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