diff --git a/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs b/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs index 0851f65..eb42fd0 100644 --- a/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs +++ b/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs @@ -45,7 +45,7 @@ public void UnloadData() { } public void Update() { - if (MasterSession.I == null || Log.IsUnloaded) + if (MasterSession.I == null || Log._unloaded) return; _networkLoadUpdate--; @@ -64,7 +64,7 @@ public void Update() { private void ReceivedPacket(ushort channelId, byte[] serialized, ulong senderSteamId, bool isSenderServer) { // Add check if mod is unloaded - if (MasterSession.I == null || Log.IsUnloaded) + if (MasterSession.I == null || Log._unloaded) return; try { @@ -78,7 +78,7 @@ private void ReceivedPacket(ushort channelId, byte[] serialized, ulong senderSte HandlePacket(packet, senderSteamId); } catch (Exception ex) { - if (!Log.IsUnloaded) + if (!Log._unloaded) Log.Error(ex); } } @@ -91,7 +91,7 @@ private void HandlePacket(PacketBase packet, ulong senderSteamId) { packet.Received(senderSteamId); } catch (Exception ex) { - if (!Log.IsUnloaded) + if (!Log._unloaded) Log.Error(ex); } } diff --git a/ConfigurableGridPoints/Data/Scripts/ShipPoints/Logger.cs b/ConfigurableGridPoints/Data/Scripts/ShipPoints/Logger.cs index 4636c9a..347787d 100644 --- a/ConfigurableGridPoints/Data/Scripts/ShipPoints/Logger.cs +++ b/ConfigurableGridPoints/Data/Scripts/ShipPoints/Logger.cs @@ -37,8 +37,7 @@ public class Log : MySessionComponentBase { private static Log _instance; private static Handler _handler; - private static bool _unloaded; - public bool IsUnloaded { get; set; } + public static bool _unloaded; public static readonly string File = GenerateTimestampedFileName(); @@ -277,7 +276,7 @@ public override void LoadData() { } protected override void UnloadData() { - IsUnloaded = true; + _unloaded = true; _instance = null; if (_handler != null && _handler.AutoClose) Unload();