Only add DFN to search path if not a subdir of the other path

feature/opengl3
kaetemi 5 years ago
parent dd1043eaae
commit 2faa1d7ab8

@ -103,6 +103,8 @@ int main(int nNbArg, char **ppArgs)
// add search paths // add search paths
CPath::addSearchPath(leveldesignDir, true, false); CPath::addSearchPath(leveldesignDir, true, false);
std::string relativeDfnDir = dfnDir; // only add dfn if not a subdir of leveldesignDir
if (!CPath::makePathRelative(leveldesignDir, dfnDir) || relativeDfnDir.size() < 2 || (relativeDfnDir[0] == '.' && relativeDfnDir[1] == '.'))
CPath::addSearchPath(dfnDir, true, false); CPath::addSearchPath(dfnDir, true, false);
// create the audio mixer // create the audio mixer

@ -82,6 +82,8 @@ int main(int nNbArg, char **ppArgs)
// add search paths // add search paths
CPath::addSearchPath(leveldesignDir, true, false); CPath::addSearchPath(leveldesignDir, true, false);
std::string relativeDfnDir = dfnDir; // only add dfn if not a subdir of leveldesignDir
if (!CPath::makePathRelative(leveldesignDir, dfnDir) || relativeDfnDir.size() < 2 || (relativeDfnDir[0] == '.' && relativeDfnDir[1] == '.'))
CPath::addSearchPath(dfnDir, true, false); CPath::addSearchPath(dfnDir, true, false);
// build the sound bank // build the sound bank

Loading…
Cancel
Save