Fixed GetComponentString not working with custom types and registered/added missing types

This commit is contained in:
EvilFactory
2023-02-13 17:06:48 -03:00
parent aaffb54141
commit 5003d0beb7
4 changed files with 10 additions and 1 deletions
@@ -57,10 +57,12 @@ namespace Barotrauma
{
public object GetComponentString(string component)
{
Type type = Type.GetType("Barotrauma.Items.Components." + component);
Type type = LuaUserData.GetType("Barotrauma.Items.Components." + component);
if (type == null)
{
return null;
}
MethodInfo method = typeof(Item).GetMethod(nameof(Item.GetComponent));
MethodInfo generic = method.MakeGenericMethod(type);