added support for independent "zero-bots" (bots without an own source file)
[NeonServV5.git] / src / cmd_global_commands.c
index e0cfba056a836031ccb7bbc1f21252ca19ffd804..4008574f911acff754f4d6d14bb55f3603db30ec 100644 (file)
@@ -29,13 +29,13 @@ CMD_BIND(global_cmd_commands) {
     struct cmd_binding *cbind;
     int bindcount = 0;
     for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
-        if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
+        if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && !(cbind->func->flags & CMDFLAG_FUNCMD))
             bindcount++;
     }
     struct cmd_binding *binds[bindcount];
     bindcount = 0;
     for(cbind = getAllBinds(NULL); cbind; cbind = getAllBinds(cbind)) {
-        if(cbind->botid == client->botid && !(cbind->func->flags & CMDFLAG_FUNCMD))
+        if(cbind->botid == client->botid && (cbind->botid || cbind->clientid == client->clientid) && !(cbind->func->flags & CMDFLAG_FUNCMD))
             binds[bindcount++] = cbind;
     }
     qsort(binds, bindcount, sizeof(struct cmd_binding *), global_cmd_commands_sort);