Add support for sub folder style lua modules

Ex. lua_modules/?/init.lua will work (which some lua modules do use)
This commit is contained in:
Michael Cook (mackal) 2016-06-11 13:23:52 -04:00
parent d9bdcf2aec
commit 83bb10b32b

View File

@ -852,7 +852,7 @@ void LuaParser::ReloadQuests() {
lua_getglobal(L, "package"); lua_getglobal(L, "package");
lua_getfield(L, -1, "path"); lua_getfield(L, -1, "path");
std::string module_path = lua_tostring(L,-1); std::string module_path = lua_tostring(L,-1);
module_path += ";./" + Config->LuaModuleDir + "/?.lua"; module_path += ";./" + Config->LuaModuleDir + "?.lua;./" + Config->LuaModuleDir + "?/init.lua";
lua_pop(L, 1); lua_pop(L, 1);
lua_pushstring(L, module_path.c_str()); lua_pushstring(L, module_path.c_str());
lua_setfield(L, -2, "path"); lua_setfield(L, -2, "path");