From: pk910 Date: Wed, 21 Dec 2011 23:31:49 +0000 (+0100) Subject: fixed cmd_linker output for empty subcommand list X-Git-Tag: v5.3~123 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=687672c92fac0cb4e91f400d74069cbdfe8f7e9a fixed cmd_linker output for empty subcommand list --- diff --git a/src/modcmd.c b/src/modcmd.c index aca47f6..6f0ade7 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -163,6 +163,8 @@ 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 && (cbind->botid || cbind->clientid == client->clientid) && stricmp(cbind->cmd, message) == 0) { + //get a text bot + tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0)); if(cbind->func->func == modcmd_linker) { //links subcommands char command[MAXLEN]; @@ -191,7 +193,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s subcompos += sprintf(subcommands + subcompos, (subcompos ? ", %s" : "%s"), cbind->cmd + commandlen); } } - reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, subcommands); + reply(tmp_text_client, user, "MODCMD_SUBCOMMANDS", parent_bind->cmd, (subcompos ? subcommands : "none")); break; } } @@ -204,8 +206,6 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s break; chan = sent_chan; } - //get a text bot - tmp_text_client = get_botwise_prefered_bot(client->botid, (client->botid == 0 ? client->clientid : 0)); //parse the arguments... char *arga[MAXNUMPARAMS]; char **argv;