mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Fix TrinityScripts to use the correct config file when -c config_name.conf is used on the trinitycore commandline, thanks to gixxer_j for getting me to finally fix it, and for testing the patch. Be sure to do a full recompile, or you may get errors, this may even require a fresh pull from the repo for some.
--HG-- branch : trunk
This commit is contained in:
@@ -50,7 +50,7 @@ void ScriptsFree()
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
void ScriptsInit()
|
||||
void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
{
|
||||
nrscripts = 0;
|
||||
num_inst_scripts = 0;
|
||||
|
||||
@@ -1332,7 +1332,7 @@ void ScriptsFree()
|
||||
}
|
||||
|
||||
TRINITY_DLL_EXPORT
|
||||
void ScriptsInit()
|
||||
void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
{
|
||||
bool CanLoadDB = true;
|
||||
|
||||
@@ -1347,12 +1347,12 @@ void ScriptsInit()
|
||||
outstring_log("");
|
||||
|
||||
//Get configuration file
|
||||
if (!TScriptConfig.SetSource(_TRINITY_SCRIPT_CONFIG))
|
||||
if (!TScriptConfig.SetSource(cfg_file))
|
||||
{
|
||||
CanLoadDB = false;
|
||||
error_log("TSCR: Unable to open configuration file. Database will be unaccessible. Configuration values will use default.");
|
||||
}
|
||||
else outstring_log("TSCR: Using configuration file %s",_TRINITY_SCRIPT_CONFIG);
|
||||
else outstring_log("TSCR: Using configuration file %s",cfg_file);
|
||||
|
||||
EAI_ErrorLevel = TScriptConfig.GetIntDefault("EAIErrorLevel", 1);
|
||||
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#include "Common.h"
|
||||
#include "Platform/Define.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "World.h"
|
||||
#include "Config/ConfigEnv.h"
|
||||
|
||||
ScriptsSet Script=NULL;
|
||||
|
||||
@@ -95,7 +97,7 @@ bool LoadScriptingModule(char const* libName)
|
||||
UnloadScriptingModule();
|
||||
|
||||
Script=testScript;
|
||||
Script->ScriptsInit();
|
||||
Script->ScriptsInit(sConfig.GetFilename().c_str());
|
||||
|
||||
sWorld.SetScriptsVersion(Script->ScriptsVersion());
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class InstanceData;
|
||||
bool LoadScriptingModule(char const* libName = "");
|
||||
void UnloadScriptingModule();
|
||||
|
||||
typedef void(TRINITY_IMPORT * scriptCallScriptsInit) ();
|
||||
typedef void(TRINITY_IMPORT * scriptCallScriptsInit) (char const*);
|
||||
typedef void(TRINITY_IMPORT * scriptCallScriptsFree) ();
|
||||
typedef char const* (TRINITY_IMPORT * scriptCallScriptsVersion) ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user