Since no matching command was found returning false so other plugin after TShock have chance to handle the chat message.

This commit is contained in:
ricky 2011-06-21 13:03:02 +10:00
parent e8b1059152
commit dd63436d29

View file

@ -177,19 +177,18 @@ namespace TShockAPI
if (cmd == null) if (cmd == null)
{ {
return false;
}
if (!cmd.CanRun(player))
{
Tools.SendLogs(string.Format("{0} tried to execute {1}", player.Name, cmd.Name), Color.Red);
player.SendMessage("You do not have access to that command.", Color.Red);
} }
else else
{ {
if (!cmd.CanRun(player)) Tools.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red);
{ cmd.Run(cmdText, player, args);
Tools.SendLogs(string.Format("{0} tried to execute {1}", player.Name, cmd.Name), Color.Red);
player.SendMessage("You do not have access to that command.", Color.Red);
}
else
{
Tools.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red);
cmd.Run(cmdText, player, args);
}
} }
return true; return true;
} }