From 2faa1d7ab86aff1c11769512fa65ee7293d70b33 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 13 Nov 2019 13:50:03 +0800 Subject: [PATCH] Only add DFN to search path if not a subdir of the other path --- code/nel/tools/sound/build_sound/build_sound.cpp | 4 +++- code/nel/tools/sound/build_soundbank/build_soundbank.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/nel/tools/sound/build_sound/build_sound.cpp b/code/nel/tools/sound/build_sound/build_sound.cpp index 7762c1bf2..dbb47dd02 100644 --- a/code/nel/tools/sound/build_sound/build_sound.cpp +++ b/code/nel/tools/sound/build_sound/build_sound.cpp @@ -103,7 +103,9 @@ int main(int nNbArg, char **ppArgs) // add search paths CPath::addSearchPath(leveldesignDir, true, false); - CPath::addSearchPath(dfnDir, 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); // create the audio mixer UAudioMixer *audioMixer = UAudioMixer::createAudioMixer(); diff --git a/code/nel/tools/sound/build_soundbank/build_soundbank.cpp b/code/nel/tools/sound/build_soundbank/build_soundbank.cpp index f672592e2..082b08e90 100644 --- a/code/nel/tools/sound/build_soundbank/build_soundbank.cpp +++ b/code/nel/tools/sound/build_soundbank/build_soundbank.cpp @@ -82,7 +82,9 @@ int main(int nNbArg, char **ppArgs) // add search paths CPath::addSearchPath(leveldesignDir, true, false); - CPath::addSearchPath(dfnDir, 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); // build the sound bank UAudioMixer::buildSoundBank(exportDir);