From a91c6ea0a88a8e2ef370af1f9fe0bfe79200b0ff Mon Sep 17 00:00:00 2001 From: vl Date: Mon, 14 Feb 2011 18:03:49 +0100 Subject: [PATCH] Changed: use bundle resource if default cfg is not found --- code/ryzom/client/src/init.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/init.cpp b/code/ryzom/client/src/init.cpp index 474cd8aac..7ae13500c 100644 --- a/code/ryzom/client/src/init.cpp +++ b/code/ryzom/client/src/init.cpp @@ -577,12 +577,19 @@ void checkDriverDepth () static std::string replaceApplicationDirToken(const std::string &dir) { + +#ifdef NL_OS_MAC + // if client_default.cfg is not in current directory, and it's not an absolute path, use application default directory + if (!CFile::isExists("client_default.cfg") && dir.size()>0 && dir[0]!='/') + { + return getAppBundlePath() + "/Contents/Resources/" + dir; + } +#else static const std::string token = ""; - std::string::size_type pos = dir.find(token); - if (pos != std::string::npos) return dir.substr(0, pos) + getAppBundlePath() + dir.substr(pos + token.length()); +#endif // preDataPath = getAppBundlePath() + "/Contents/Resources/" + preDataPath;