Don't allow core commands to be unloaded by using their shortcut

This commit is contained in:
UnknownShadow200 2017-06-04 09:26:15 +10:00
parent c856372f07
commit e9d12b5127

View File

@ -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);