From 56fe067bde280feb1b252f3b32ad96b4196da9f4 Mon Sep 17 00:00:00 2001 From: data-bomb Date: Fri, 3 May 2024 19:22:53 -0700 Subject: [PATCH] Fix for Resource Score Logging - Fixes error where built-in team count isn't yet defined --- Si_Logging/Si_Logging.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Si_Logging/Si_Logging.cs b/Si_Logging/Si_Logging.cs index 87c8c6c..5b6d376 100644 --- a/Si_Logging/Si_Logging.cs +++ b/Si_Logging/Si_Logging.cs @@ -42,7 +42,7 @@ You should have received a copy of the GNU General Public License using System.Diagnostics; using System.IO; -[assembly: MelonInfo(typeof(HL_Logging), "Half-Life Logger", "1.2.5", "databomb&zawedcvg", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(HL_Logging), "Half-Life Logger", "1.2.6", "databomb&zawedcvg", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -51,8 +51,8 @@ namespace Si_Logging // https://developer.valvesoftware.com/wiki/HL_Log_Standard public class HL_Logging : MelonMod { - const int MaxTeams = 3; - static int[] teamResourcesCollected = new int[Team.NumTeams]; + const int MaxPlayableTeams = 3; + static int[] teamResourcesCollected = new int[MaxPlayableTeams + 1]; static Player?[]? lastCommander; static MelonPreferences_Category _modCategory = null!; @@ -157,8 +157,8 @@ public override void OnInitializeMelon() AddFirstLogLine(); } - lastCommander = new Player?[MaxTeams]; - for (int i = 0; i < MaxTeams; i++) + lastCommander = new Player?[MaxPlayableTeams]; + for (int i = 0; i < MaxPlayableTeams; i++) { lastCommander[i] = null; }