fix formatting in lua require and better error handling with dofile,loadfile,etc

This commit is contained in:
Evil Factory
2022-05-04 08:50:17 -03:00
parent 7a6ddccbb7
commit bbea195e7d
6 changed files with 148 additions and 169 deletions
@@ -116,16 +116,24 @@ namespace Barotrauma
if (write)
{
if (CanWriteToPath(path))
{
return true;
}
else
{
GameMain.LuaCs.HandleException(new Exception("File access to \"" + path + "\" not allowed."));
}
}
else
{
if (CanReadFromPath(path))
{
return true;
}
else
{
GameMain.LuaCs.HandleException(new Exception("File access to \"" + path + "\" not allowed."));
}
}
return false;