fix: Fixes duplicate command listed. (#1677)

This commit is contained in:
Kamron Batman 2024-02-11 18:13:45 -08:00 committed by GitHub
parent 4479555156
commit 48e47f9352
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -96,7 +96,7 @@ public static class HelpInfo
.ReplaceOrdinal("<", "(")
.ReplaceOrdinal(">", ")");
if (e.Handler.Target == null && usage == null && desc == null)
if (e.Handler.Target != null && usage == null && desc == null)
{
continue;
}
@ -104,7 +104,7 @@ public static class HelpInfo
var aliasesAttr = mi.GetCustomAttribute(typeof(AliasesAttribute), false) as AliasesAttribute;
var aliases = aliasesAttr?.Aliases;
list.Add(new CommandInfo(e.AccessLevel, e.Command, aliases, usage, null, desc));
list.Add(new CommandInfo(e.AccessLevel, e.Command, aliases, usage ?? e.Command, null, desc ?? "No description available."));
}
for (var i = 0; i < TargetCommands.AllCommands.Count; ++i)
@ -130,7 +130,7 @@ public static class HelpInfo
desc = desc
.ReplaceOrdinal("<", "(")
.ReplaceOrdinal(">", ")");
.ReplaceOrdinal(">", ")") ?? "No description available.";
List<string> modsList = [];

View file

@ -846,6 +846,8 @@ namespace Server.Factions
e.Mobile.SendMessage($"{count} items reset");
}
[Usage("FactionCommander")]
[Description("Sets the targeted player as the faction commander.")]
public static void FactionCommander_OnCommand(CommandEventArgs e)
{
e.Mobile.SendMessage("Target a player to make them the faction commander.");

Binary file not shown.