forgot to remove the member of the descriptor in case it already existed

This commit is contained in:
Evil Factory
2021-10-31 12:32:16 -03:00
parent 77bd8c3720
commit f4d6c686fe

View File

@@ -401,6 +401,7 @@ namespace Barotrauma
var descriptor = (StandardUserDataDescriptor)UserData.RegisterType<NetLobbyScreen>();
var type = typeof(NetLobbyScreen);
var field = type.GetField("subs", BindingFlags.NonPublic | BindingFlags.Instance);
descriptor.RemoveMember("subs");
descriptor.AddMember("subs", new FieldMemberDescriptor(field, InteropAccessMode.Default));
}
@@ -566,6 +567,8 @@ namespace Barotrauma
DoFile("Mods/LuaForBarotrauma/Lua/MoonsharpSetup.lua");
else // fallback to c# script loading
{
PrintMessage("Lua/MoonSharp.lua not found, loading Mods directly, things can break!");
List<string> modulePaths = new List<string>();
foreach (string d in Directory.GetDirectories("Mods"))