calling lua function inside an async function causes lots of issues (probably caused by the fact that it runs on a separate thread?), solved by creating a queue of functions to be called on the main thread

This commit is contained in:
Evil Factory
2021-11-08 14:29:07 -03:00
parent 07b6bcc32b
commit 50427390f2
4 changed files with 34 additions and 7 deletions
@@ -394,6 +394,7 @@ namespace Barotrauma
TaskPool.Update();
CoroutineManager.Update((float)Timing.Step, (float)Timing.Step);
GameMain.Lua.Update();
GameMain.Lua.hook.Call("think", new object[] { });
performanceMeasurement.Stop();
LuaSetup.LuaTimer.LastUpdateTime = performanceMeasurement.ElapsedMilliseconds;