From 1268b8e862b8a3dc5854b745590e61d350f6251f Mon Sep 17 00:00:00 2001 From: InvalidArgument3 Date: Sat, 26 Oct 2024 21:35:39 -0500 Subject: [PATCH] Update HeartNetwork.cs --- .../ShipPoints/HeartNetworking/HeartNetwork.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs b/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs index d072a67..0851f65 100644 --- a/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs +++ b/ConfigurableGridPoints/Data/Scripts/ShipPoints/HeartNetworking/HeartNetwork.cs @@ -44,15 +44,16 @@ public void UnloadData() { I = null; } - public void Update() - { + public void Update() { + if (MasterSession.I == null || Log.IsUnloaded) + return; + _networkLoadUpdate--; - if (_networkLoadUpdate <= 0) - { + if (_networkLoadUpdate <= 0) { _networkLoadUpdate = NetworkLoadTicks; TotalNetworkLoad = 0; - foreach (var networkLoadArray in TypeNetworkLoad.Keys.ToArray()) - { + + foreach (var networkLoadArray in TypeNetworkLoad.Keys.ToArray()) { TotalNetworkLoad += TypeNetworkLoad[networkLoadArray]; TypeNetworkLoad[networkLoadArray] = 0; }