Skip to content

Commit

Permalink
Merge pull request #2943 from sgkoishi/dump-commands
Browse files Browse the repository at this point in the history
Fix dump-reference-data mutate command name
  • Loading branch information
hakusaro authored Jan 25, 2025
2 parents 78dd32a + 748b516 commit 2755450
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions TShockAPI/Permissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,18 +529,9 @@ public static void DumpDescriptions()
field.GetCustomAttributes(false).FirstOrDefault(o => o is DescriptionAttribute) as DescriptionAttribute;
var desc = descattr != null && !string.IsNullOrWhiteSpace(descattr.Description) ? descattr.Description : GetString("No description available.");

var commands = GetCommands(name);
foreach (var c in commands)
{
for (var i = 0; i < c.Names.Count; i++)
{
c.Names[i] = "/" + c.Names[i];
}
}
var strs =
commands.Select(
c =>
c.Name + (c.Names.Count > 1 ? " ({0})".SFormat(string.Join(" ", c.Names.ToArray(), 1, c.Names.Count - 1)) : ""));
var strs = GetCommands(name).Select(c => c.Names.Count > 1
? $"/{c.Name} (/{string.Join(" /", c.Names.Skip(1))})"
: $"/{c.Name}");

sb.AppendLine($"## {name}");
sb.AppendLine($"{desc}");
Expand Down
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
* If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. -->

## Upcoming changes
* You know the drill
* Fixed `/dump-reference-data` mutate the command names. (#2943, @sgkoishi)

## TShock 5.2.1
* Updated `TSPlayer.GodMode`. (@AgaSpace)
Expand Down

0 comments on commit 2755450

Please sign in to comment.