From dfafd48f08ca0d719c678cc7b826c7589d2f2a0f Mon Sep 17 00:00:00 2001 From: vis2k Date: Fri, 20 Aug 2021 20:59:13 +0800 Subject: [PATCH] SyncObjectProcessor: remove static WeavingFailed reference --- .../Editor/Weaver/Processors/NetworkBehaviourProcessor.cs | 2 +- Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/Processors/NetworkBehaviourProcessor.cs b/Assets/Mirror/Editor/Weaver/Processors/NetworkBehaviourProcessor.cs index 6973484d7..c8bc389b1 100644 --- a/Assets/Mirror/Editor/Weaver/Processors/NetworkBehaviourProcessor.cs +++ b/Assets/Mirror/Editor/Weaver/Processors/NetworkBehaviourProcessor.cs @@ -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) diff --git a/Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs b/Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs index cd15b9b01..61fc72ca0 100644 --- a/Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs +++ b/Assets/Mirror/Editor/Weaver/Processors/SyncObjectProcessor.cs @@ -7,7 +7,7 @@ public static class SyncObjectProcessor { // Finds SyncObjects fields in a type // Type should be a NetworkBehaviour - public static List FindSyncObjectsFields(Writers writers, Readers readers, Logger Log, TypeDefinition td) + public static List FindSyncObjectsFields(Writers writers, Readers readers, Logger Log, TypeDefinition td, ref bool WeavingFailed) { List syncObjects = new List(); @@ -18,7 +18,7 @@ public static List FindSyncObjectsFields(Writers writers, Reade if (fd.IsStatic) { Log.Error($"{fd.Name} cannot be static", fd); - Weaver.WeavingFailed = true; + WeavingFailed = true; continue; }