From eace021468119662f72c0d2dd9a10dce01e1a20e Mon Sep 17 00:00:00 2001 From: data-bomb Date: Fri, 15 Nov 2024 18:03:39 -0800 Subject: [PATCH] Fix Nominate Command - Fixes bugs related to the !nominate command to allow accepting either a map filename or a display name as an argument. The following will achieve the same outcome: -- !nominate Brenn's Chasm -- !nominate RiftBasin_TD - Changes !nominate feedback to use the map's display name --- Si_Mapcycle/Si_Mapcycle.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Si_Mapcycle/Si_Mapcycle.cs b/Si_Mapcycle/Si_Mapcycle.cs index 5266c9b..3143992 100644 --- a/Si_Mapcycle/Si_Mapcycle.cs +++ b/Si_Mapcycle/Si_Mapcycle.cs @@ -39,7 +39,7 @@ You should have received a copy of the GNU General Public License using System.Linq; using UnityEngine; -[assembly: MelonInfo(typeof(MapCycleMod), "Mapcycle", "1.6.6", "databomb", "https://github.com/data-bomb/Silica")] +[assembly: MelonInfo(typeof(MapCycleMod), "Mapcycle", "1.6.7", "databomb", "https://github.com/data-bomb/Silica")] [assembly: MelonGame("Bohemia Interactive", "Silica")] [assembly: MelonOptionalDependencies("Admin Mod")] @@ -357,7 +357,7 @@ public static void Command_Nominate(Player? callerPlayer, String args) // gather map or display name int nominateOffset = args.IndexOf(' '); - string nominateTarget = args.Substring(nominateOffset); + string nominateTarget = args.Substring(nominateOffset+1); // ensure global vars populated if (sMapCycle == null || sMapCycle.Length <= 0) @@ -412,7 +412,7 @@ public static void Command_Nominate(Player? callerPlayer, String args) return; } - HelperMethods.ReplyToCommand_Player(callerPlayer, "nominated " + levelInfo.FileName + " as a map for the rock the vote list."); + HelperMethods.ReplyToCommand_Player(callerPlayer, "nominated " + levelInfo.DisplayName + " as a map for the rock the vote list."); mapNominations.Add(levelInfo.FileName); } @@ -830,13 +830,13 @@ private static string GetDisplayName(string mapName) private static string GetMapName(string displayName) { - LevelInfo? levelInfo = GetLevelInfo(displayName); + LevelInfo? levelInfo = GetLevelInfo(displayName, true); if (levelInfo == null) { return ""; } - return levelInfo.DisplayName; + return levelInfo.FileName; } private static bool IsMapDisplayNameValid(string displayName)