X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fmodcmd.c;h=058612a2b353cd09887d543c67d5ddf000389947;hp=9846db20115da854a7f7f0861214ac840762bee2;hb=391260f64a1dfb35bf0a55e7044fe1b8d83f2561;hpb=74495e70c2a89dc7dd938c5278cb256bd3820c9e diff --git a/src/modcmd.c b/src/modcmd.c index 9846db2..058612a 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -704,6 +704,8 @@ int unbind_botwise_cmd(int botid, int clientid, char *cmd) { for(i = 0; i < cbind->paramcount; i++) free(cbind->parameters[i]); } + if(cbind->channel_access) + free(cbind->channel_access); free(cbind); return 1; } else @@ -712,6 +714,33 @@ int unbind_botwise_cmd(int botid, int clientid, char *cmd) { return 0; } +int unbind_botwise_allcmd(int clientid) { + int i; + for(i = 0; i < 27; i++) { + struct cmd_binding *cbind, *next, *last = NULL; + for(cbind = cmd_binds[i]; cbind; cbind = next) { + next = cbind->next; + if(clientid == cbind->clientid) { + if(last) + last->next = cbind->next; + else + cmd_binds[i] = cbind->next; + free(cbind->cmd); + if(cbind->paramcount) { + int j; + for(j = 0; j < cbind->paramcount; j++) + free(cbind->parameters[j]); + } + if(cbind->channel_access) + free(cbind->channel_access); + free(cbind); + } else + last = cbind; + } + } + return 1; +} + struct cmd_function *find_cmd_function(int botid, char *name) { struct cmd_function *cmdfunc; char *c;