From f8b41d51f1b760a433c2dbf997ed852b7dd94945 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 3 Jan 2016 21:30:23 +0000 Subject: MirLua: fixed script loading git-svn-id: http://svn.miranda-ng.org/main/trunk@16014 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'plugins/MirLua/src/mlua.cpp') 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()) { -- cgit v1.2.3