If /help second argument starts with /, remove it
This commit is contained in:
parent
fd66407ccf
commit
311fbde46e
1 changed files with 8 additions and 2 deletions
|
|
@ -3388,7 +3388,13 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Command command = ChatCommands.Find(c => c.Names.Contains(args.Parameters[0].ToLower()));
|
string commandName = args.Parameters[0].ToLower();
|
||||||
|
if (commandName.StartsWith("/"))
|
||||||
|
{
|
||||||
|
commandName = commandName.Substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Command command = ChatCommands.Find(c => c.Names.Contains(commandName));
|
||||||
if (command == null)
|
if (command == null)
|
||||||
{
|
{
|
||||||
args.Player.SendErrorMessage("Invalid command.");
|
args.Player.SendErrorMessage("Invalid command.");
|
||||||
|
|
@ -3400,7 +3406,7 @@ namespace TShockAPI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Player.SendSuccessMessage("/{0} help: ", args.Parameters[0].ToLower());
|
args.Player.SendSuccessMessage("/{0} help: ", command.Name);
|
||||||
args.Player.SendInfoMessage(command.HelpText);
|
args.Player.SendInfoMessage(command.HelpText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue