Weaver PropertySiteProcessor: remove redundant AssemblyDefinition parameter. Weaver passes assembly.MainModule anyway.

This commit is contained in:
vis2k 2020-08-21 18:25:01 +02:00
parent 4258220b26
commit 5cc908a18d
2 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ namespace Mirror.Weaver
{
public static class PropertySiteProcessor
{
public static void ProcessSitesModule(AssemblyDefinition assembly, ModuleDefinition moduleDef)
public static void ProcessSitesModule(ModuleDefinition moduleDef)
{
DateTime startTime = DateTime.Now;
@ -21,16 +21,16 @@ public static void ProcessSitesModule(AssemblyDefinition assembly, ModuleDefinit
if (Weaver.WeaveLists.generateContainerClass != null)
{
moduleDef.Types.Add(Weaver.WeaveLists.generateContainerClass);
assembly.MainModule.ImportReference(Weaver.WeaveLists.generateContainerClass);
moduleDef.ImportReference(Weaver.WeaveLists.generateContainerClass);
foreach (MethodDefinition f in Weaver.WeaveLists.generatedReadFunctions)
{
assembly.MainModule.ImportReference(f);
moduleDef.ImportReference(f);
}
foreach (MethodDefinition f in Weaver.WeaveLists.generatedWriteFunctions)
{
assembly.MainModule.ImportReference(f);
moduleDef.ImportReference(f);
}
}
Console.WriteLine(" ProcessSitesModule " + moduleDef.Name + " elapsed time:" + (DateTime.Now - startTime));

View File

@ -331,7 +331,7 @@ static bool Weave(string assName, AssemblyDefinition unityAssembly, AssemblyDefi
// this must be done for ALL code, not just NetworkBehaviours
try
{
PropertySiteProcessor.ProcessSitesModule(CurrentAssembly, moduleDefinition);
PropertySiteProcessor.ProcessSitesModule(moduleDefinition);
}
catch (Exception e)
{