diff options
author | spacechase0 <spacechase0@users.noreply.github.com> | 2020-08-17 20:28:51 -0400 |
---|---|---|
committer | spacechase0 <spacechase0@users.noreply.github.com> | 2020-08-17 20:28:51 -0400 |
commit | f012dae8728df55ab8803de1f269aee480ccc49b (patch) | |
tree | 10831bd416cf63b821ef583b9dd20fc5d6b634fb /src/SMAPI/Framework | |
parent | 6afb80676becc337f7c381d71171d36c53e219ee (diff) | |
download | SMAPI-f012dae8728df55ab8803de1f269aee480ccc49b.tar.gz SMAPI-f012dae8728df55ab8803de1f269aee480ccc49b.tar.bz2 SMAPI-f012dae8728df55ab8803de1f269aee480ccc49b.zip |
Fix harmony attributes not workign cross-platform
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyLoader.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs index dbb5f696..c8c1ca08 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs @@ -292,6 +292,19 @@ namespace StardewModdingAPI.Framework.ModLoading IEnumerable<TypeReference> typeReferences = module.GetTypeReferences().OrderBy(p => p.FullName); foreach (TypeReference type in typeReferences) this.ChangeTypeScope(type); + + // rewrite types using custom attributes + foreach (TypeDefinition type in module.GetTypes()) + { + foreach (var attr in type.CustomAttributes) + { + foreach (var conField in attr.ConstructorArguments) + { + if (conField.Value is TypeReference typeRef) + this.ChangeTypeScope(typeRef); + } + } + } } // find or rewrite code |