From dd63436d29940a6610d085074aa6ef2533d9dc32 Mon Sep 17 00:00:00 2001 From: ricky Date: Tue, 21 Jun 2011 13:03:02 +1000 Subject: [PATCH] Since no matching command was found returning false so other plugin after TShock have chance to handle the chat message. --- TShockAPI/Commands.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index a9eef720..1aa1bb27 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -177,19 +177,18 @@ namespace TShockAPI 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 { - 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 - { - Tools.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red); - cmd.Run(cmdText, player, args); - } + Tools.SendLogs(string.Format("{0} executed: /{1}", player.Name, cmdText), Color.Red); + cmd.Run(cmdText, player, args); } return true; }