Fix Lua `require` not looking in Lua dir on Linux
see #3485 thanks to @CasualPokePlayer for research and initial implementation
This commit is contained in:
parent
9e4836d300
commit
cbb335fec2
|
@ -104,6 +104,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
_lua.RegisterFunction("print", this, typeof(Win32LuaLibraries).GetMethod(nameof(Print)));
|
||||
if (OSTailoredCode.IsUnixHost)
|
||||
{
|
||||
// add %exe%/Lua to library resolution pathset (LUA_PATH)
|
||||
// this is done already on windows, but not on linux it seems?
|
||||
var packageTable = (LuaTable) _lua["package"];
|
||||
var luaPath = PathEntries.LuaAbsolutePath();
|
||||
packageTable["path"] = $"{luaPath}/?.lua;{luaPath}?/init.lua;{packageTable["path"]}";
|
||||
}
|
||||
|
||||
EmulationLuaLibrary.FrameAdvanceCallback = Frameadvance;
|
||||
EmulationLuaLibrary.YieldCallback = EmuYield;
|
||||
|
|
Loading…
Reference in New Issue