[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.iavalley.cc.ia.us
Tue Jan 30 23:39:01 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-01-31 05:38:17 UTC

Modified files:
     doc/UPDATES1.6 src/patch.h src/mod/irc.mod/irc.c

Log message:

more revengebot crap <g> Thanks fabian, the code is cleaner ..

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.55 eggdrop1.6/doc/UPDATES1.6:1.56
--- eggdrop1.6/doc/UPDATES1.6:1.55	Tue Jan 30 23:34:23 2001
+++ eggdrop1.6/doc/UPDATES1.6	Tue Jan 30 23:38:06 2001
@@ -8,7 +8,8 @@
           Tothwolf  Improved Tcl version reporting
 habeeb    Sup       Updated the help channels in README.
 PPSlim    PPSlim/   +revengebot no longer requires that the bot has a 
-          guppy     user-record for itself.
+          guppy/    user-record for itself.
+          Fabian
 project10 guppy     made the reserved-port setting into reserved-portrange
 various   Tothwolf  added i18n support to fix our problems with tcl
           PPSlim    some minor doc fixes
Index: eggdrop1.6/src/mod/irc.mod/irc.c
diff -u eggdrop1.6/src/mod/irc.mod/irc.c:1.48 eggdrop1.6/src/mod/irc.mod/irc.c:1.49
--- eggdrop1.6/src/mod/irc.mod/irc.c:1.48	Mon Jan 22 22:33:56 2001
+++ eggdrop1.6/src/mod/irc.mod/irc.c	Tue Jan 30 23:38:06 2001
@@ -2,7 +2,7 @@
  * irc.c -- part of irc.mod
  *   support for channels within the bot 
  * 
- * $Id: irc.c,v 1.48 2001/01/23 04:33:56 guppy Exp $
+ * $Id: irc.c,v 1.49 2001/01/31 05:38:06 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -79,43 +79,44 @@
 
 
 /* Contains the logic to decide wether we want to punish someone. Returns
- * true if we want to, false if not.
+ * true (1) if we want to, false (0) if not.
  */
 static int want_to_revenge(struct chanset_t *chan, struct userrec *u,
 			   struct userrec *u2, char *badnick, char *victim,
 			   int mevictim)
 {
   struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
-  struct flag_record fr2 = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
 
-  /* Do not take revenge upon ourselves */
+  /* Do not take revenge upon ourselves. */
   if (match_my_nick(badnick))
     return 0;
 
-  get_user_flagrec(u2, &fr2, chan->dname);
-
-  /* Why protect people we do not even know? */
-  if (!u2)
-    return 0;
-
   get_user_flagrec(u, &fr, chan->dname);
  
   /* Kickee is not a friend? */
   if (!chan_friend(fr) && !glob_friend(fr) &&
       /* ... and they didn't kick themself? */
       rfc_casecmp(badnick, victim)) {
-    /* They kicked ME? and I'm revenging?... muahaHAHAHA! */
+    /* They kicked me? */
     if (mevictim) {
+      /* ... and I'm allowed to take revenge? <snicker> */
       if (channel_revengebot(chan))
         return 1;
-    } else if (channel_revenge(chan) &&
-              /* ... and protecting friends, and kicked is a valid friend? */
-             ((channel_protectfriends(chan) &&
-               (chan_friend(fr2) || (glob_friend(fr2) && !chan_deop(fr2)))) ||
-              /* ... or protecting ops and kicked is valid op? */
-              (channel_protectops(chan) &&
-               (chan_op(fr2) || (glob_op(fr2) && !chan_deop(fr2))))))
-      return 1;
+    /* Do we revenge for our users ... and do we actually know the victim? */
+    } else if (channel_revenge(chan) && u2) {
+      struct flag_record fr2 = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
+
+      get_user_flagrec(u2, &fr2, chan->dname);
+      /* Protecting friends? */
+      if ((channel_protectfriends(chan) &&
+	   /* ... and victim is valid friend? */
+	   (chan_friend(fr2) || (glob_friend(fr2) && !chan_deop(fr2)))) ||
+	  /* ... or protecting ops */
+	  (channel_protectops(chan) &&
+	   /* ... and kicked is valid op? */
+	   (chan_op(fr2) || (glob_op(fr2) && !chan_deop(fr2)))))
+	return 1;
+    }
   }
   return 0;
 }
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.424 eggdrop1.6/src/patch.h:1.425
--- eggdrop1.6/src/patch.h:1.424	Tue Jan 30 23:34:23 2001
+++ eggdrop1.6/src/patch.h	Tue Jan 30 23:38:06 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  * 
- * $Id: patch.h,v 1.424 2001/01/31 05:34:23 guppy Exp $
+ * $Id: patch.h,v 1.425 2001/01/31 05:38:06 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("980919244");		/* current unixtime */
+patch("980919355");		/* current unixtime */
 /*
  *
  *
  */
-patch("sigterm-default");
+patch("revengebot2");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list