summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/environment.cpp')
-rw-r--r--plugins/MirLua/src/environment.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/plugins/MirLua/src/environment.cpp b/plugins/MirLua/src/environment.cpp
index 76a34cbc55..88e7bff62b 100644
--- a/plugins/MirLua/src/environment.cpp
+++ b/plugins/MirLua/src/environment.cpp
@@ -8,16 +8,14 @@ CMLuaEnvironment::CMLuaEnvironment(lua_State *_l) :
CMPluginBase(nullptr, pluginInfoEx),
L(_l)
{
- MUUID muidLast = MIID_LAST;
- m_hLang = GetPluginLangId(muidLast, 0);
}
CMLuaEnvironment::~CMLuaEnvironment()
{
- KillModuleIcons(m_hLang);
- KillModuleSounds(m_hLang);
- KillModuleMenus(m_hLang);
- KillModuleHotkeys(m_hLang);
+ KillModuleIcons(this);
+ KillModuleSounds(this);
+ KillModuleMenus(this);
+ KillModuleHotkeys(this);
KillObjectEventHooks(this);
KillObjectServices(this);
@@ -41,12 +39,10 @@ CMLuaEnvironment* CMLuaEnvironment::GetEnvironment(lua_State *L)
return env;
}
-int CMLuaEnvironment::GetEnvironmentId(lua_State *L)
+HPLUGIN CMLuaEnvironment::GetEnvironmentId(lua_State *L)
{
CMLuaEnvironment *env = GetEnvironment(L);
- return env != nullptr
- ? env->m_hLang
- : g_hMLuaLangpack;
+ return env != nullptr ? HPLUGIN(env) : &g_plugin;
}
static int HookEventEnvParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param)