Core/Scripting: Use the path of the worldserver executable to search for the scripts dir

* Fixes issues when starting the worldserver not in the bin directory
  or the CMAKE_INSTALL_PREFIX directory using the -c option.

(cherry picked from commit 86b0fcf67a)
This commit is contained in:
Naios
2016-04-18 20:29:42 +02:00
parent 2809f11839
commit 51ec8d3b8c
5 changed files with 53 additions and 20 deletions

View File

@@ -26,11 +26,13 @@
using namespace boost::property_tree;
bool ConfigMgr::LoadInitial(std::string const& file, std::string& error)
bool ConfigMgr::LoadInitial(std::string const& file, std::vector<std::string> args,
std::string& error)
{
std::lock_guard<std::mutex> lock(_configLock);
_filename = file;
_args = args;
try
{
@@ -66,7 +68,7 @@ ConfigMgr* ConfigMgr::instance()
bool ConfigMgr::Reload(std::string& error)
{
return LoadInitial(_filename, error);
return LoadInitial(_filename, std::move(_args), error);
}
template<class T>