Try an improvement for #2073 (stk does not start if /data

exists).
This commit is contained in:
hiker 2015-04-05 22:14:48 +10:00
parent 4135ed4be2
commit 67d5e41d2c

View File

@ -160,19 +160,19 @@ FileManager::FileManager()
#ifdef __APPLE__ #ifdef __APPLE__
else if( macSetBundlePathIfRelevant( root_dir ) ) { root_dir = root_dir + "data/"; } else if( macSetBundlePathIfRelevant( root_dir ) ) { root_dir = root_dir + "data/"; }
#endif #endif
else if(m_file_system->existFile("data")) else if(m_file_system->existFile("data/stk_config.xml"))
root_dir = "data/" ; root_dir = "data/" ;
else if(m_file_system->existFile("../data")) else if(m_file_system->existFile("../data/stk_config.xml"))
root_dir = "../data/" ; root_dir = "../data/" ;
else if(m_file_system->existFile("../../data")) else if(m_file_system->existFile("../../data/stk_config.xml"))
root_dir = "../../data/" ; root_dir = "../../data/" ;
// Test for old style build environment, with executable in root of stk // Test for old style build environment, with executable in root of stk
else if(m_file_system->existFile(exe_path+"data")) else if(m_file_system->existFile(exe_path+"data/stk_config.xml"))
root_dir = (exe_path+"data/").c_str(); root_dir = (exe_path+"data/").c_str();
// Check for windows cmake style: bld/Debug/bin/supertuxkart.exe // Check for windows cmake style: bld/Debug/bin/supertuxkart.exe
else if (m_file_system->existFile(exe_path + "../../../data")) else if (m_file_system->existFile(exe_path + "../../../data/stk_config.xml"))
root_dir = (exe_path + "../../../data/").c_str(); root_dir = (exe_path + "../../../data/").c_str();
else if (m_file_system->existFile(exe_path + "../data")) else if (m_file_system->existFile(exe_path + "../data/stk_config.xml"))
{ {
root_dir = exe_path.c_str(); root_dir = exe_path.c_str();
root_dir += "../data/"; root_dir += "../data/";