From 61f7ad2f76728d4b6b3c9506a024812a4381be0d Mon Sep 17 00:00:00 2001 From: Koncord Date: Mon, 5 Dec 2016 23:54:01 +0800 Subject: [PATCH] Add new paths for native & lua libs If you want to add the native lib you should place it to {PATH_TO_MOD}/lib/ for external Lua libs: {PATH_TO_MOD}/lib/lua/ --- apps/openmw-mp/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/main.cpp b/apps/openmw-mp/main.cpp index a5191669e..400c0c9c6 100644 --- a/apps/openmw-mp/main.cpp +++ b/apps/openmw-mp/main.cpp @@ -196,7 +196,15 @@ int main(int argc, char *argv[]) setenv("AMXFILE", moddir.c_str(), 1); setenv("MOD_DIR", moddir.c_str(), 1); // hack for lua - setenv("LUA_PATH", Utils::convertPath(plugin_home + "/scripts/?.lua" + ";" + plugin_home + "/scripts/?.t").c_str(), 1); + setenv("LUA_PATH", Utils::convertPath(plugin_home + "/scripts/?.lua" + ";" + + plugin_home + "/scripts/?.t" + ";" + + plugin_home + "/lib/lua/?.lua" + ";" + + plugin_home + "/lib/lua/?.t").c_str(), 1); +#ifdef _WIN32 + setenv("LUA_CPATH", Utils::convertPath(plugin_home + "/lib/?.dll").c_str(), 1); +#else + setenv("LUA_CPATH", Utils::convertPath(plugin_home + "/lib/?.so").c_str(), 1); +#endif for (auto plugin : plugins) Script::LoadScript(plugin.c_str(), plugin_home.c_str());