forgot this.
This commit is contained in:
@@ -9,6 +9,7 @@ using Microsoft.CodeAnalysis;
|
||||
using System.Runtime.Loader;
|
||||
using System.Reflection.PortableExecutable;
|
||||
using System.Reflection.Metadata;
|
||||
using MoonSharp.Interpreter;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -97,7 +98,11 @@ namespace Barotrauma
|
||||
if (runner != null)
|
||||
{
|
||||
var method = runner.GetType().GetMethod("Run", BindingFlags.Public | BindingFlags.Instance);
|
||||
if (method != null) scriptResilt = method.Invoke(runner, null);
|
||||
if (method != null)
|
||||
{
|
||||
scriptResilt = method.Invoke(runner, null);
|
||||
foreach (var type in assembly.GetTypes()) { UserData.UnregisterType(type, true); }
|
||||
}
|
||||
else LuaCsSetup.PrintCsError("Script Error - no run method detected");
|
||||
}
|
||||
else LuaCsSetup.PrintCsError("Script Error - no runner class detected");
|
||||
|
||||
Reference in New Issue
Block a user