X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcmd_global_modcmd.c;h=1506a358076b2b85a64e3563ef6c930741403f51;hb=b53d0c5f88063f075a48a0426f9d5d6b3490b9fc;hp=a5f36ad98760c1a813ed2b74fddce90206fc224c;hpb=5a9d04e79a4d27880eb5a588cbc50e00a4cd26aa;p=NeonServV5.git diff --git a/src/cmd_global_modcmd.c b/src/cmd_global_modcmd.c index a5f36ad..1506a35 100644 --- a/src/cmd_global_modcmd.c +++ b/src/cmd_global_modcmd.c @@ -1,5 +1,5 @@ /* cmd_global_modcmd.c - NeonServ v5.3 - * Copyright (C) 2011 Philipp Kreil (pk910) + * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,6 +112,7 @@ static const struct { {"OPLOG", CMDFLAG_OPLOG}, {"FUNCMD", CMDFLAG_FUNCMD}, {"ESCAPED_ARGS", CMDFLAG_ESCAPE_ARGS}, //allows arguments to be escaped ("a\ b" = "a b" as one argument) + {"NO_CROSSCHAN", CMDFLAG_NO_CROSSCHAN}, {NULL, 0} }; @@ -119,11 +120,13 @@ static int global_cmd_modcmd_flags(struct UserNode *user, struct cmd_binding *cb char flags[MAXLEN]; int flagpos = 0; int ret = 0; + unsigned int visible_flags = 0; int i = 0; while(global_cmd_modcmd_show_flags[i].name) { if(cbind->func->flags & global_cmd_modcmd_show_flags[i].flag) { flagpos += sprintf(flags + flagpos, (flagpos ? " %s" : "\00314%s"), global_cmd_modcmd_show_flags[i].name); } + visible_flags |= global_cmd_modcmd_show_flags[i].flag; i++; } if(flagpos) @@ -156,9 +159,9 @@ static int global_cmd_modcmd_flags(struct UserNode *user, struct cmd_binding *cb else cbind->flags &= ~current_flag; if(cbind->botid == 0) - printf_mysql_query("UPDATE `bot_binds` SET `flags` = '%u' WHERE `botclass` = '0' AND `botid` = '%d' AND `command` = '%s'", cbind->flags, cbind->clientid, escape_string(cbind->cmd)); + printf_mysql_query("UPDATE `bot_binds` SET `flags` = '%u' WHERE `botclass` = '0' AND `botid` = '%d' AND `command` = '%s'", (cbind->flags & visible_flags), cbind->clientid, escape_string(cbind->cmd)); else - printf_mysql_query("UPDATE `bot_binds` SET `flags` = '%u' WHERE `botclass` = '%d' AND `command` = '%s'", cbind->flags, cbind->botid, escape_string(cbind->cmd)); + printf_mysql_query("UPDATE `bot_binds` SET `flags` = '%u' WHERE `botclass` = '%d' AND `command` = '%s'", (cbind->flags & visible_flags), cbind->botid, escape_string(cbind->cmd)); ret = 1; } i = 0;