X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcmd_global_modcmd.c;h=cc242f94a66096e55a60e88298c20df01901662d;hb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb;hp=a5f36ad98760c1a813ed2b74fddce90206fc224c;hpb=5a9d04e79a4d27880eb5a588cbc50e00a4cd26aa;p=NeonServV5.git diff --git a/src/cmd_global_modcmd.c b/src/cmd_global_modcmd.c index a5f36ad..cc242f9 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 @@ -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;