From a3ddd8471e3e3f20fcbadd493ce5864a3cb9a6e3 Mon Sep 17 00:00:00 2001 From: pk910 Date: Wed, 2 Nov 2011 00:08:20 +0100 Subject: [PATCH] ignore funcmd's in cmd_commands and disallow channel comprehensive fun commands --- src/cmd_global_commands.c | 4 ++-- src/modcmd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd_global_commands.c b/src/cmd_global_commands.c index 53f90bd..0b6d16c 100644 --- a/src/cmd_global_commands.c +++ b/src/cmd_global_commands.c @@ -29,13 +29,13 @@ CMD_BIND(global_cmd_commands) { struct cmd_binding *cbind; int bindcount = 0; for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) { - if(cbind->botid == client->botid) + if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD)) bindcount++; } struct cmd_binding *binds[bindcount]; bindcount = 0; for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) { - if(cbind->botid == client->botid) + if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD)) binds[bindcount++] = cbind; } qsort(binds, bindcount, sizeof(struct cmd_binding *), global_cmd_commands_sort); diff --git a/src/modcmd.c b/src/modcmd.c index 8b9c72c..856da05 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -153,7 +153,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s struct cmd_binding *cbind; for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) { if(cbind->botid == client->botid && stricmp(cbind->cmd, message) == 0) { - if((cbind->flags & CMDFLAG_FUNCMD)) { + if((cbind->func->flags & CMDFLAG_FUNCMD)) { if(!sent_chan) break; chan = sent_chan; -- 2.20.1