From 8624d4e78a0a5e0e686d761e7264c200ffd4e0e7 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 12 Jan 2020 01:21:49 -0600 Subject: [PATCH] Fixed accessor --- IPA.Loader/Utilities/Accessor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IPA.Loader/Utilities/Accessor.cs b/IPA.Loader/Utilities/Accessor.cs index d3a5a42a..dba9e434 100644 --- a/IPA.Loader/Utilities/Accessor.cs +++ b/IPA.Loader/Utilities/Accessor.cs @@ -36,6 +36,8 @@ namespace IPA.Utilities var il = dyn.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); + if (!typeof(U).IsValueType) + il.Emit(OpCodes.Ldind_Ref); il.Emit(OpCodes.Ldflda, field); il.Emit(OpCodes.Ret); @@ -148,8 +150,8 @@ namespace IPA.Utilities if (prop == null) throw new MissingMemberException(typeof(T).Name, propName); - var getM = prop.GetGetMethod(); - var setM = prop.GetSetMethod(); + var getM = prop.GetGetMethod(true); + var setM = prop.GetSetMethod(true); Getter getter = null; Setter setter = null; if (getM != null)