Fix LuaUserData.IsTargetType not behaving as originally due to it comparing types

This commit is contained in:
EvilFactory
2022-12-06 18:58:28 -03:00
parent 244dd8fad6
commit 505b6af2ee
@@ -85,7 +85,7 @@ namespace Barotrauma
if (targetType == null) { throw new ScriptRuntimeException("target type not found"); }
Type type = obj is Type ? (Type)obj : obj.GetType();
return type == targetType;
return targetType.IsAssignableFrom(type);
}
public static string TypeOf(object obj)