fixed last commit
[NeonServV5.git] / modcmd.c
index 5c07fb4e4828011040b799d0ec5dd05729ec3a38..37b0fee23d1ce07601ef9fbf065606e82ceef5e6 100644 (file)
--- a/modcmd.c
+++ b/modcmd.c
@@ -299,7 +299,7 @@ int register_command(int botid, char *name, cmd_bind_t *func, int paramcount, un
     cmdfunc->botid = botid;
     cmdfunc->name = strdup(name);
     cmdfunc->func = func;
-    cmdfunc->flags = 0;
+    cmdfunc->flags = flags;
     cmdfunc->paramcount = paramcount;
     cmdfunc->next = cmd_functions;
     cmd_functions = cmdfunc;
@@ -450,7 +450,16 @@ void free_modcmd() {
 }
 
 void bind_set_parameters(int botid, char *cmd, char *parameters) {
-    
+    int bind_index = get_binds_index(cmd[0]);
+    struct cmd_binding *cbind;
+    for(cbind = cmd_binds[bind_index]; cbind; cbind = cbind->next) {
+        if(cbind->botid == botid && strcmp(cbind->cmd, cmd) == 0) {
+            if(cbind->parameters)
+                free(cbind->parameters);
+            cbind->parameters = strdup(parameters);
+            return;
+        }
+    }
 }
 
 void bind_set_gaccess(int botid, char *cmd, int gaccess) {