From ba6c22643a9acbef0fc10a748ea038d1873ad08b Mon Sep 17 00:00:00 2001 From: data-bomb Date: Sat, 16 Nov 2024 11:14:13 -0800 Subject: [PATCH] Fix Round Start Error in Tower Defense - Logs the round starting for both MP_Strategy and MP_TowerDefense game modes - Adds logging of the (gamemode "") - Only logs the versus mode (gametype) on MP_Strategy --- Si_Logging/Si_Logging.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Si_Logging/Si_Logging.cs b/Si_Logging/Si_Logging.cs index 95491d5..a5e08db 100644 --- a/Si_Logging/Si_Logging.cs +++ b/Si_Logging/Si_Logging.cs @@ -44,7 +44,7 @@ You should have received a copy of the GNU General Public License using System.Text; using System.Runtime.CompilerServices; -[assembly: MelonInfo(typeof(HL_Logging), "Half-Life Logger", "1.4.13", "databomb&zawedcvg", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(HL_Logging), "Half-Life Logger", "1.4.14", "databomb&zawedcvg", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -950,10 +950,15 @@ public static void Prefix(MusicJukeboxHandler __instance, GameMode __0) { try { - MP_Strategy strategyInstance = GameObject.FindObjectOfType(); - MP_Strategy.ETeamsVersus versusMode = strategyInstance.TeamsVersus; + string RoundStartLogLine = "World triggered \"Round_Start\" (gamemode \"" + GameMode.CurrentGameMode.ToString().Split(' ')[0] + "\")"; - string RoundStartLogLine = "World triggered \"Round_Start\" (gametype \"" + versusMode.ToString() + "\")"; + if (GameMode.CurrentGameMode is MP_Strategy) + { + MP_Strategy strategyInstance = GameObject.FindObjectOfType(); + MP_Strategy.ETeamsVersus versusMode = strategyInstance.TeamsVersus; + RoundStartLogLine += " (gametype \"" + versusMode.ToString() + "\")"; + } + PrintLogLine(RoundStartLogLine); initializeRound(ref currTiers);