summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-03 19:02:24 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-06-03 19:02:24 -0400
commit43a9ee42aac1eaf2ff630d164bc425718a531a64 (patch)
tree07f891a26429d7e31596aad175e9a51e86e4760a /src/SMAPI/Framework
parent80f882baf3f1854e32df3546fc4d4485c2aab68f (diff)
downloadSMAPI-43a9ee42aac1eaf2ff630d164bc425718a531a64.tar.gz
SMAPI-43a9ee42aac1eaf2ff630d164bc425718a531a64.tar.bz2
SMAPI-43a9ee42aac1eaf2ff630d164bc425718a531a64.zip
don't prevent mods from accessing game methods/properties extended by SMAPI
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
index 86c327ed..916c215d 100644
--- a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs
@@ -122,7 +122,8 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <returns>Returns the same property instance for convenience.</returns>
private IReflectedProperty<T> AssertAccessAllowed<T>(IReflectedProperty<T> property)
{
- this.AssertAccessAllowed(property?.PropertyInfo);
+ this.AssertAccessAllowed(property?.PropertyInfo.GetMethod?.GetBaseDefinition());
+ this.AssertAccessAllowed(property?.PropertyInfo.SetMethod?.GetBaseDefinition());
return property;
}
@@ -131,7 +132,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <returns>Returns the same method instance for convenience.</returns>
private IReflectedMethod AssertAccessAllowed(IReflectedMethod method)
{
- this.AssertAccessAllowed(method?.MethodInfo);
+ this.AssertAccessAllowed(method?.MethodInfo.GetBaseDefinition());
return method;
}