Skip to content

Commit

Permalink
Fix Nominate Command
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
data-bomb committed Nov 16, 2024
1 parent 2b63ceb commit eace021
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Si_Mapcycle/Si_Mapcycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit eace021

Please sign in to comment.