-/* cmd_global_commands.c - NeonServ v5.2
+/* cmd_global_commands.c - NeonServ v5.3
* Copyright (C) 2011 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
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);