Jelajahi Sumber

* Fixed a roleid bug, even though I'll probably strip roles

svn: 1222
Bryan Drewery 22 tahun lalu
induk
melakukan
a869027dae
2 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 3 1
      src/botnet.c
  2. 2 2
      src/mod/channels.mod/channels.c

+ 3 - 1
src/botnet.c

@@ -1649,9 +1649,11 @@ static int get_role(char *bot)
 
   if (!(u2 = get_user_by_handle(userlist, bot)))
     return 1;
+  if (bot_hublevel(u2) != 999)
+    return 0;
 
   for (u = userlist; u; u = u->next) {
-    if (u->bot) {
+    if (u->bot && bot_hublevel(u) == 999) {
       if (strcmp(u->handle, bot)) {
         ba = get_user(&USERENTRY_BOTADDR, u);
         if ((nextbot(u->handle) >= 0) && (ba) && (ba->roleid > 0) && (ba->roleid < 5))

+ 2 - 2
src/mod/channels.mod/channels.c

@@ -324,7 +324,7 @@ static void rebalance_roles()
   char tmp[10] = "";
 
   for (i = 0; i < (unsigned) dcc_total; i++) {
-    if (dcc[i].user && dcc[i].user->bot) {
+    if (dcc[i].user && dcc[i].user->bot && bot_hublevel(dcc[i].user) == 999) {
       ba = get_user(&USERENTRY_BOTADDR, dcc[i].user);
       if (ba && (ba->roleid > 0) && (ba->roleid < 5))
         r[(ba->roleid - 1)]++;
@@ -346,7 +346,7 @@ static void rebalance_roles()
   }
   while (r[hNdx] - r[lNdx] >= 2) {
     for (i = 0; i < (unsigned) dcc_total; i++) {
-      if (dcc[i].user && dcc[i].user->bot) {
+      if (dcc[i].user && dcc[i].user->bot && bot_hublevel(dcc[i].user) == 999) {
         ba = get_user(&USERENTRY_BOTADDR, dcc[i].user);
         if (ba && (ba->roleid == (hNdx + 1))) {
           ba->roleid = lNdx + 1;