From e9d12b5127913539adeaa96af052886b2316d069 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 4 Jun 2017 09:26:15 +1000 Subject: [PATCH] Don't allow core commands to be unloaded by using their shortcut --- MCGalaxy/Commands/Scripting/CmdCmdUnload.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MCGalaxy/Commands/Scripting/CmdCmdUnload.cs b/MCGalaxy/Commands/Scripting/CmdCmdUnload.cs index 8e4e97ee2..d02e39163 100644 --- a/MCGalaxy/Commands/Scripting/CmdCmdUnload.cs +++ b/MCGalaxy/Commands/Scripting/CmdCmdUnload.cs @@ -26,15 +26,15 @@ namespace MCGalaxy.Commands.Scripting { if (message == "") { Help(p); return; } string cmdName = message.SplitSpaces()[0]; - if (Command.core.Contains(cmdName)) { - Player.Message(p, "/{0} is a core command, you cannot unload it.", cmdName); return; - } - Command cmd = Command.all.Find(cmdName); if (cmd == null) { Player.Message(p, "\"{0}\" is not a valid or loaded command.", cmdName); return; } + if (Command.core.Contains(cmd)) { + Player.Message(p, "/{0} is a core command, you cannot unload it.", cmdName); return; + } + Command.all.Remove(cmd); foreach (Group grp in Group.GroupList) grp.commands.Remove(cmd);