SyncObjectProcessor: remove static WeavingFailed reference

This commit is contained in:
vis2k 2021-08-20 20:59:13 +08:00
parent b87096d5c9
commit dfafd48f08
2 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public bool Process(ref bool WeavingFailed)
// deconstruct tuple and set fields
(syncVars, syncVarNetIds) = syncVarProcessor.ProcessSyncVars(netBehaviourSubclass);
syncObjects = SyncObjectProcessor.FindSyncObjectsFields(writers, readers, Log, netBehaviourSubclass);
syncObjects = SyncObjectProcessor.FindSyncObjectsFields(writers, readers, Log, netBehaviourSubclass, ref WeavingFailed);
ProcessMethods(ref WeavingFailed);
if (Weaver.WeavingFailed)

View File

@ -7,7 +7,7 @@ public static class SyncObjectProcessor
{
// Finds SyncObjects fields in a type
// Type should be a NetworkBehaviour
public static List<FieldDefinition> FindSyncObjectsFields(Writers writers, Readers readers, Logger Log, TypeDefinition td)
public static List<FieldDefinition> FindSyncObjectsFields(Writers writers, Readers readers, Logger Log, TypeDefinition td, ref bool WeavingFailed)
{
List<FieldDefinition> syncObjects = new List<FieldDefinition>();
@ -18,7 +18,7 @@ public static List<FieldDefinition> FindSyncObjectsFields(Writers writers, Reade
if (fd.IsStatic)
{
Log.Error($"{fd.Name} cannot be static", fd);
Weaver.WeavingFailed = true;
WeavingFailed = true;
continue;
}