summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-01-03 21:30:23 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-01-03 21:30:23 +0000
commitf8b41d51f1b760a433c2dbf997ed852b7dd94945 (patch)
treec7a7cb6f6fc8b8bbdc8e63b9c67fe584f7470a9a /plugins/MirLua/src/mlua.cpp
parent99d0352e7dd98a8d05247f1a446d212499b08a50 (diff)
MirLua: fixed script loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@16014 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r--plugins/MirLua/src/mlua.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp
index 7256c2b6df..dc0699182e 100644
--- a/plugins/MirLua/src/mlua.cpp
+++ b/plugins/MirLua/src/mlua.cpp
@@ -20,15 +20,14 @@ CMLua::~CMLua()
void CMLua::SetPaths()
{
TCHAR path[MAX_PATH];
+ FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
lua_getglobal(L, "package");
- FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_CPATHT));
- lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
+ lua_pushfstring(L, "%s\\?.dll", ptrA(mir_utf8encodeT(path)));
lua_setfield(L, -2, "cpath");
- FoldersGetCustomPathT(g_hScriptsFolder, path, _countof(path), VARST(MIRLUA_PATHT));
- lua_pushstring(L, ptrA(mir_utf8encodeT(path)));
+ lua_pushfstring(L, "%s\\?.lua", ptrA(mir_utf8encodeT(path)));
lua_setfield(L, -2, "path");
lua_pop(L, 1);
@@ -36,9 +35,9 @@ void CMLua::SetPaths()
void CMLua::Load()
{
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)"Loading lua engine");
+ Log("Loading lua engine");
L = luaL_newstate();
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)"Loading std modules");
+ Log("Loading std modules");
luaL_openlibs(L);
SetPaths();
@@ -57,14 +56,14 @@ void CMLua::Load()
MUUID muidLast = MIID_LAST;
hScriptsLangpack = GetPluginLangId(muidLast, 0);
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)"Loading miranda modules");
+ Log("Loading miranda modules");
CLuaModuleLoader::Load(L);
CLuaScriptLoader::Load(L);
}
void CMLua::Unload()
{
- CallService(MS_NETLIB_LOG, (WPARAM)hNetlib, (LPARAM)"Unloading lua engine");
+ Log("Unloading lua engine");
while (int last = Scripts.getCount())
{