X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fmodcmd.c;h=8b9c72c4573ab60000075d2e6a14e20df36861f9;hb=5eee43a7cfa37d5dd8d8a612a94de09a048b30c0;hp=6b769eac56c6b2017cac2268cd3854d1e907148c;hpb=ffc462dec2b405f14d7b13d37e17b95ea6fdf2f5;p=NeonServV5.git diff --git a/src/modcmd.c b/src/modcmd.c index 6b769ea..8b9c72c 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -153,6 +153,11 @@ 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(!sent_chan) + break; + chan = sent_chan; + } //get a text bot tmp_text_client = get_prefered_bot(client->botid); //parse the arguments... @@ -768,7 +773,7 @@ void bind_unbound_required_functions(int botid) { } } -void register_bot_alias(int botid, char *alias) { +void register_command_alias(int botid, char *alias) { struct cmd_bot_alias *botalias; for(botalias = bot_aliases; botalias; botalias = botalias->next) { if(!stricmp(botalias->alias, alias)) @@ -785,3 +790,20 @@ void register_bot_alias(int botid, char *alias) { bot_aliases = botalias; } +struct cmd_binding *getAllBinds(struct cmd_binding *last) { + int bind_index; + if(last) { + if(last->next) + return last->next; + bind_index = get_binds_index(last->cmd[0]) + 1; + if(bind_index > 26) + return NULL; + } else + bind_index = 0; + do { + if(cmd_binds[bind_index]) + return cmd_binds[bind_index]; + bind_index++; + } while(bind_index < 27); + return NULL; +}