diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-29 22:20:53 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-29 22:20:53 +0300 |
commit | ae4580fcc45128e40499184fad2ffb04d0620c95 (patch) | |
tree | 27d6622753d4846d7dfad7948610820f94fe25a6 | |
parent | 2a0f820b2c70a57073cafff090a8ba52b46679ea (diff) |
fix for registering Lua scripts
-rw-r--r-- | plugins/MirLua/src/environment.cpp | 4 | ||||
-rw-r--r-- | plugins/MirLua/src/variables_loader.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/plugins/MirLua/src/environment.cpp b/plugins/MirLua/src/environment.cpp index 1816483a17..517cff243b 100644 --- a/plugins/MirLua/src/environment.cpp +++ b/plugins/MirLua/src/environment.cpp @@ -4,9 +4,13 @@ extern PLUGININFOEX pluginInfoEx; +EXTERN_C MIR_APP_DLL(void) RegisterPlugin(CMPluginBase *pPlugin); + CMLuaEnvironment::CMLuaEnvironment(lua_State *L) : CMPluginBase(nullptr, pluginInfoEx), L(L) { + m_hInst = (HINSTANCE)this; + ::RegisterPlugin(this); } int CMLuaEnvironment::Unload() diff --git a/plugins/MirLua/src/variables_loader.cpp b/plugins/MirLua/src/variables_loader.cpp index 423b5aa475..4fdd5975b2 100644 --- a/plugins/MirLua/src/variables_loader.cpp +++ b/plugins/MirLua/src/variables_loader.cpp @@ -123,7 +123,7 @@ static int mlua__rand(lua_State *L) return 1; } -static wchar_t* translate(lua_State *L, const wchar_t *format, const wchar_t *extra, MCONTACT hContact = NULL) +static wchar_t* translate(lua_State *L, const wchar_t *format, const wchar_t* /*extra*/, MCONTACT /*hContact*/ = NULL) { std::wregex regex(L"\\?([a-z_0-9]+)\\("); std::wstring query = std::regex_replace(format, regex, L"_v$1("); |