Prevent some types from being re-registered

This commit is contained in:
EvilFactory
2023-05-08 13:13:47 -03:00
parent 836e5daca6
commit 886fa9ed80
2 changed files with 13 additions and 5 deletions
@@ -23,16 +23,16 @@ namespace Barotrauma
return UserData.RegisterType(type);
}
public static IUserDataDescriptor IsRegistered(string typeName)
public static bool IsRegistered(string typeName)
{
Type type = GetType(typeName);
if (type == null)
{
return null;
return false;
}
return UserData.GetDescriptorForType(type, true);
return UserData.GetDescriptorForType(type, true) != null;
}
public static void UnregisterType(string typeName, bool deleteHistory = false)