mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
fix(Config): replace deprecated functions for AzerothCore (#7)
This commit is contained in:
@@ -65,6 +65,8 @@ namespace LuaGlobalFunctions
|
|||||||
{
|
{
|
||||||
#ifdef MANGOS
|
#ifdef MANGOS
|
||||||
Eluna::Push(L, realmID);
|
Eluna::Push(L, realmID);
|
||||||
|
#elif defined(AZEROTHCORE)
|
||||||
|
Eluna::Push(L, sConfigMgr->GetOption<uint32>("RealmID", 1));
|
||||||
#else
|
#else
|
||||||
Eluna::Push(L, sConfigMgr->GetIntDefault("RealmID", 1));
|
Eluna::Push(L, sConfigMgr->GetIntDefault("RealmID", 1));
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -107,7 +107,12 @@ void Eluna::LoadScriptPaths()
|
|||||||
lua_scripts.clear();
|
lua_scripts.clear();
|
||||||
lua_extensions.clear();
|
lua_extensions.clear();
|
||||||
|
|
||||||
|
#if defined(AZEROTHCORE)
|
||||||
|
lua_folderpath = eConfigMgr->GetOption<std::string>("Eluna.ScriptPath", "lua_scripts");
|
||||||
|
#else
|
||||||
lua_folderpath = eConfigMgr->GetStringDefault("Eluna.ScriptPath", "lua_scripts");
|
lua_folderpath = eConfigMgr->GetStringDefault("Eluna.ScriptPath", "lua_scripts");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ELUNA_WINDOWS
|
#ifndef ELUNA_WINDOWS
|
||||||
if (lua_folderpath[0] == '~')
|
if (lua_folderpath[0] == '~')
|
||||||
if (const char* home = getenv("HOME"))
|
if (const char* home = getenv("HOME"))
|
||||||
@@ -215,7 +220,12 @@ void Eluna::CloseLua()
|
|||||||
|
|
||||||
void Eluna::OpenLua()
|
void Eluna::OpenLua()
|
||||||
{
|
{
|
||||||
|
#if defined(AZEROTHCORE)
|
||||||
|
enabled = eConfigMgr->GetOption<bool>("Eluna.Enabled", true);
|
||||||
|
#else
|
||||||
enabled = eConfigMgr->GetBoolDefault("Eluna.Enabled", true);
|
enabled = eConfigMgr->GetBoolDefault("Eluna.Enabled", true);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!IsEnabled())
|
if (!IsEnabled())
|
||||||
{
|
{
|
||||||
ELUNA_LOG_INFO("[Eluna]: Eluna is disabled in config");
|
ELUNA_LOG_INFO("[Eluna]: Eluna is disabled in config");
|
||||||
@@ -583,7 +593,12 @@ bool Eluna::ExecuteCall(int params, int res)
|
|||||||
ASSERT(false); // stack probably corrupt
|
ASSERT(false); // stack probably corrupt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(AZEROTHCORE)
|
||||||
|
bool usetrace = eConfigMgr->GetOption<bool>("Eluna.TraceBack", false);
|
||||||
|
#else
|
||||||
bool usetrace = eConfigMgr->GetBoolDefault("Eluna.TraceBack", false);
|
bool usetrace = eConfigMgr->GetBoolDefault("Eluna.TraceBack", false);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (usetrace)
|
if (usetrace)
|
||||||
{
|
{
|
||||||
lua_pushcfunction(L, &StackTrace);
|
lua_pushcfunction(L, &StackTrace);
|
||||||
|
|||||||
Reference in New Issue
Block a user