fix Game.RoundStarted and improve error handling
This commit is contained in:
@@ -119,9 +119,9 @@ namespace Barotrauma
|
||||
get
|
||||
{
|
||||
#if SERVER
|
||||
return GameMain.Server.GameStarted;
|
||||
return GameMain.Server?.GameStarted == true;
|
||||
#else
|
||||
return GameMain.Client.GameStarted;
|
||||
return GameMain.Client?.GameStarted == true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace Barotrauma
|
||||
|
||||
if (methodInfo == null)
|
||||
{
|
||||
string parameterNamesStr = parameterNames == null ? "" : string.Join(", ", parameterNames == null);
|
||||
string parameterNamesStr = parameterNames == null ? "" : string.Join(", ", parameterNames);
|
||||
GameMain.LuaCs.HandleException(new Exception($"Method '{methodName}' with parameters '{parameterNamesStr}' not found in class '{className}'"));
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.LuaCs.HandleException(new Exception("File access to \"" + path + "\" not allowed."));
|
||||
throw new Exception("File access to \"" + path + "\" not allowed.");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -100,12 +100,11 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.LuaCs.HandleException(new Exception("File access to \"" + path + "\" not allowed."));
|
||||
throw new Exception("File access to \"" + path + "\" not allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsPathAllowedLuaException(string path, bool write = true) =>
|
||||
IsPathAllowedException(path, write, LuaCsSetup.ExceptionType.Lua);
|
||||
public static bool IsPathAllowedCsException(string path, bool write = true) =>
|
||||
|
||||
Reference in New Issue
Block a user