Skip to content

Commit

Permalink
Fixed Lua dispose method not being called if you reload manually
Browse files Browse the repository at this point in the history
  • Loading branch information
evilfactory committed Dec 17, 2023
1 parent a846ff2 commit a0044d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ public void Stop()
public void Initialize(bool forceEnableCs = false)
{
if (IsInitialized)
{
Stop();
}

IsInitialized = true;

LuaCsLogger.LogMessage("Lua! Version " + AssemblyInfo.GitRevision);

Expand Down Expand Up @@ -479,8 +483,6 @@ public void Initialize(bool forceEnableCs = false)
{
ModUtils.Logging.PrintError($"{nameof(LuaCsSetup)}::{nameof(Initialize)}() | Error while loading assemblies! Details: {e.Message} | {e.StackTrace}");
}

IsInitialized = true;
}


Expand Down

0 comments on commit a0044d0

Please sign in to comment.