add an try catch to better see what might be causing this unknown crash,

This commit is contained in:
Evil Factory
2022-02-01 22:38:44 -03:00
parent 28b08becd1
commit efc62387ff
2 changed files with 10 additions and 4 deletions
@@ -1003,11 +1003,10 @@ namespace Barotrauma
{ {
Spawner.CreateNetworkEvent(newCharacter, false); Spawner.CreateNetworkEvent(newCharacter, false);
} }
#endif
GameMain.Lua.hook.Call("characterCreated", new object[] { newCharacter }); GameMain.Lua.hook.Call("characterCreated", new object[] { newCharacter });
#endif
return newCharacter; return newCharacter;
} }
@@ -1033,9 +1033,16 @@ namespace Barotrauma
public void Update() public void Update()
{ {
if (queuedFunctionCalls.TryDequeue(out Tuple<object, object[]> result)) try
{ {
env.CallFunction(result.Item1, result.Item2); if (queuedFunctionCalls.TryDequeue(out Tuple<object, object[]> result))
{
env.CallFunction(result.Item1, result.Item2);
}
}
catch (Exception ex)
{
env.HandleLuaException(ex, $"queuedFunctionCalls was {queuedFunctionCalls}");
} }
} }