mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 18:45:38 +00:00
Allow override of OpenMW user configuration path with OPENMW_HOME environment variable
This commit is contained in:
parent
8cb8481b37
commit
851385d989
1 changed files with 10 additions and 3 deletions
|
@ -42,9 +42,16 @@ namespace OMW
|
|||
theBasePath = macBundlePath() + "/Contents/MacOS/"; //FIXME do we have global/local with OSX?
|
||||
#elif OGRE_PLATFORM_LINUX
|
||||
const char* homedir;
|
||||
if ((homedir = getenv("HOME")) == NULL)
|
||||
return NULL;
|
||||
theBasePath = std::string(homedir)+"/."+parApp+"/";
|
||||
if ((homedir = getenv("OPENMW_HOME")) != NULL)
|
||||
{
|
||||
theBasePath = std::string(homedir)+"/";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((homedir = getenv("HOME")) == NULL)
|
||||
return NULL;
|
||||
theBasePath = std::string(homedir)+"/."+parApp+"/";
|
||||
}
|
||||
mkdir(theBasePath.c_str(), 0777);
|
||||
#else
|
||||
theBasePath = "";
|
||||
|
|
Loading…
Reference in a new issue