Merge pull request #729 from spacechase0/harmony-attribute-fix

Fix harmony attributes not working cross-platform
This commit is contained in:
Jesse Plamondon-Willard 2020-08-17 20:34:14 -04:00 committed by GitHub
commit 92eff2519c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -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