From 32c7ee794d0b3b9dd46400fa6e413ad93ab9b145 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 2 Feb 2016 19:22:25 +0100 Subject: [PATCH] Changed: Use application or current directory as root directory for patch --HG-- branch : develop --- code/ryzom/client/src/login_patch.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 72f53103f..e90035343 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -47,6 +47,7 @@ #include "nel/misc/sha1.h" #include "nel/misc/big_file.h" #include "nel/misc/i18n.h" +#include "nel/misc/cmd_args.h" #include "game_share/bg_downloader_msg.h" @@ -89,6 +90,8 @@ extern string R2ServerVersion; std::string TheTmpInstallDirectory = "patch/client_install"; #endif +extern NLMISC::CCmdArgs Args; + // **************************************************************************** // **************************************************************************** // **************************************************************************** @@ -120,8 +123,16 @@ CPatchManager::CPatchManager() : State("t_state"), DataScanState("t_data_scan_st UpdateBatchFilename = "updt_nl.sh"; #endif - // use current directory by default - setClientRootPath("./"); + // use application directory by default + std::string rootPath = Args.getProgramPath(); + + if (!CFile::fileExists(rootPath + "client_default.cfg")) + { + // use current directory + rootPath = CPath::getCurrentPath(); + } + + setClientRootPath(rootPath); VerboseLog = true;