Workaround: Hooks aren't called while in singlepalyer loading screen (fixes weird threading error)
This commit is contained in:
@@ -916,6 +916,11 @@ namespace Barotrauma
|
||||
{
|
||||
result = new LuaResult(null);
|
||||
|
||||
#if CLIENT
|
||||
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer)
|
||||
return;
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
var @params = __originalMethod.GetParameters();
|
||||
@@ -1141,6 +1146,10 @@ namespace Barotrauma
|
||||
|
||||
public object Call(string name, params object[] args)
|
||||
{
|
||||
#if CLIENT
|
||||
if (GameMain.GameSession?.IsRunning == false && GameMain.IsSingleplayer)
|
||||
return null;
|
||||
#endif
|
||||
if (env == null) return null;
|
||||
if (name == null) return null;
|
||||
if (args == null) { args = new object[] { }; }
|
||||
|
||||
Reference in New Issue
Block a user