Fixed error "Attempt to perform operations with resources owned by different script" that would sometimes happen when reloading lua

This commit is contained in:
EvilFactory
2023-03-23 12:30:20 -03:00
parent 5fc25c2453
commit 9dc87c34f3
2 changed files with 35 additions and 17 deletions
@@ -178,7 +178,7 @@ namespace Barotrauma
{
// XXX: `lua` might be null if `LuaCsSetup.Stop()` is called while
// a patched function is still running.
if (Lua == null) return null;
if (Lua == null) { return null; }
lock (Lua)
{