Przeglądaj źródła

* Fixed cmd_botcmd again.

svn: 840
Bryan Drewery 22 lat temu
rodzic
commit
fbabfbed70
1 zmienionych plików z 6 dodań i 7 usunięć
  1. 6 7
      src/cmds.c

+ 6 - 7
src/cmds.c

@@ -1507,7 +1507,7 @@ static void cmd_chsecpass(struct userrec *u, int idx, char *par)
 static void cmd_botcmd(struct userrec *u, int idx, char *par)
 {
   tand_t *tbot = NULL;
-  int cnt = 0, rleaf = (-1), tbots = 0;
+  int cnt = 0, rleaf = (-1), tbots = 0, found = 0;
   char *botm = NULL, *cmd = NULL;
   
   botm = newsplit(&par);
@@ -1537,21 +1537,20 @@ static void cmd_botcmd(struct userrec *u, int idx, char *par)
   }
   
   for (tbot = tandbot; tbot; tbot = tbot->next) {
-    if (wild_match(botm, tbot->bot))
-      cnt++;
-
     if (!strcmp(botm, "?") && bot_hublevel(get_user_by_handle(userlist, tbot->bot)) != 999)
       continue;
 
     if ((rleaf != (-1) && (cnt - 1) == rleaf) || ((rleaf == (-1) && wild_match(botm, tbot->bot)))) {
       send_remote_simul(idx, tbot->bot, cmd, par ? par : "");
+      found++;
     }
+    cnt++;
   }
 
-  if (!cnt) {
+  if (!found)
     dprintf(idx, STR("No bot matching '%s' linked\n"), botm);
-    return;
-  }
+
+  return;
 }
 
 static void cmd_hublevel(struct userrec *u, int idx, char *par)