Fix harmony attributes not workign cross-platform

This commit is contained in:
spacechase0 2020-08-17 20:28:51 -04:00
parent 6afb80676b
commit f012dae872
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