fix file loading
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Text;
|
||||
using System.IO;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Loaders;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -11,18 +12,11 @@ namespace Barotrauma
|
||||
|
||||
public class LuaScriptLoader : ScriptLoaderBase
|
||||
{
|
||||
public LuaSetup lua;
|
||||
|
||||
public LuaScriptLoader(LuaSetup l)
|
||||
{
|
||||
lua = l;
|
||||
}
|
||||
|
||||
|
||||
public override object LoadFile(string file, Table globalContext)
|
||||
{
|
||||
if (!LuaFile.IsPathAllowedLuaException(file, false)) return null;
|
||||
|
||||
if (!LuaFile.IsPathAllowedLuaException(file, false)) return null;
|
||||
|
||||
return File.ReadAllText(file);
|
||||
}
|
||||
|
||||
@@ -32,7 +26,6 @@ namespace Barotrauma
|
||||
|
||||
return File.Exists(file);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user