Skip to content

Commit 19c7f96

Browse files
committed
apply the attribute to the main module rather than the assembly
1 parent 823c5a5 commit 19c7f96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

NetcodePatcher/CodeGen/ApplyPatchedAttributeILPP.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public override bool WillProcess(ICompiledAssembly compiledAssembly)
6262
)
6363
);
6464
attr_AttributeUsage.ConstructorArguments.Add(
65-
new CustomAttributeArgument(assemblyDefinition.MainModule.ImportReference(typeof(AttributeTargets)), 1)
65+
new CustomAttributeArgument(assemblyDefinition.MainModule.ImportReference(typeof(AttributeTargets)), 2)
6666
);
6767
cls_NetcodePatchedAttribute.CustomAttributes.Add(attr_AttributeUsage);
6868

@@ -87,7 +87,7 @@ public override bool WillProcess(ICompiledAssembly compiledAssembly)
8787
var attribute = new CustomAttribute(
8888
assemblyDefinition.MainModule.ImportReference(TypeHelpers.DefaultCtorFor(cls_NetcodePatchedAttribute))
8989
);
90-
assemblyDefinition.CustomAttributes.Add(attribute);
90+
assemblyDefinition.MainModule.CustomAttributes.Add(attribute);
9191

9292
// write
9393
var pe = new MemoryStream();

0 commit comments

Comments
 (0)