Fix dump-reference-data mutate command name

This commit is contained in:
SGKoishi 2023-05-13 03:56:07 -07:00
parent c67d5cf152
commit 3d11d84d73
No known key found for this signature in database
GPG key ID: 8FFC399070653828
2 changed files with 4 additions and 13 deletions

View file

@ -529,18 +529,9 @@ namespace TShockAPI
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).Select(n => $"/{n}"))})"
: c.Name);
sb.AppendLine($"## {name}");
sb.AppendLine($"{desc}");

View file

@ -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
Your changes could be here!
* Fixed `/dump-reference-data` mutate the command names. (#2943, @sgkoishi)
## TShock 5.2
* An additional option `pvpwithnoteam` is added at `PvPMode` to enable PVP with no team. (@CelestialAnarchy, #2617, @ATFGK)