X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fcmd_global_modcmd.c;h=5a5ce2ea827c279a99cb902260b1f1537803593b;hp=a5f36ad98760c1a813ed2b74fddce90206fc224c;hb=95b073d5242d1bf995d84e3511dbc43328ebff75;hpb=67363f89107ff747af25ee1aa55d0b1904dff010 diff --git a/src/cmd_global_modcmd.c b/src/cmd_global_modcmd.c index a5f36ad..5a5ce2e 100644 --- a/src/cmd_global_modcmd.c +++ b/src/cmd_global_modcmd.c @@ -119,11 +119,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 +158,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;