From b20e8a4006cbebc90d87bba445a093f494da8c7e Mon Sep 17 00:00:00 2001
From: remoitnane <remoit(DOT)nane(AT)gmail(DOT)com>
Date: Sun, 15 Aug 2010 13:47:59 -0700
Subject: Let players spam spells again

Sorry for the inconvenience
---
 src/map/clif.c | 44 +++++++++++++++++++++++++++++++++++++-------
 1 file changed, 37 insertions(+), 7 deletions(-)

(limited to 'src')

diff --git a/src/map/clif.c b/src/map/clif.c
index e78da71..93ff805 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7149,6 +7149,15 @@ void clif_parse_GlobalMessage (int fd, struct map_session_data *sd)
 
     if (!magic_message (sd, buf, msg_len))
     {
+        /* Don't send chat that results in an automatic ban. */
+        if (tmw_CheckChatSpam (sd, message))
+        {
+            free (buf);
+            /* "Your message could not be sent." */
+            clif_displaymessage (fd, msg_txt (505));
+            return;
+        }
+
         /* It's not a spell/magic message, so send the message to others. */
         WBUFW (buf, 0) = 0x8d;
         WBUFW (buf, 2) = msg_len + 8;   /* Header (2) + length (2) + ID (4). */
@@ -7426,6 +7435,15 @@ void clif_parse_Wis (int fd, struct map_session_data *sd)
         return;
     }
 
+    /* Don't send chat that results in an automatic ban. */
+    if (tmw_CheckChatSpam (sd, message))
+    {
+        free (buf);
+        /* "Your message could not be sent." */
+        clif_displaymessage (fd, msg_txt (505));
+        return;
+    }
+
     /*
      * The player is not on this server. Only send the whisper if the name is
      * exactly the same, because if there are multiple map-servers and a name
@@ -8497,6 +8515,15 @@ void clif_parse_PartyMessage (int fd, struct map_session_data *sd)
         return;
     }
 
+    /* Don't send chat that results in an automatic ban. */
+    if (tmw_CheckChatSpam (sd, message))
+    {
+        free (buf);
+        /* "Your message could not be sent." */
+        clif_displaymessage (fd, msg_txt (505));
+        return;
+    }
+
     party_send_message (sd, message, RFIFOW (fd, 2) - 4);
     free (buf);
 }
@@ -8720,6 +8747,16 @@ void clif_parse_GuildMessage (int fd, struct map_session_data *sd)
         return;
     }
 
+    /* Don't send chat that results in an automatic ban. */
+    if (tmw_CheckChatSpam (sd, message))
+    {
+        free (buf);
+        /* "Your message could not be sent." */
+        clif_displaymessage (fd, msg_txt (505));
+        return;
+    }
+
+
     guild_send_message (sd, message, RFIFOW (fd, 2) - 4);
     free (buf);
 }
@@ -9945,13 +9982,6 @@ static char *clif_validate_chat (struct map_session_data *sd, int type,
     buf[buf_len - 1] = '\0';
     p = (type != 2) ? buf : buf + 8;
 
-    /* Don't send chat that results in an automatic ban. */
-    if (tmw_CheckChatSpam (sd, p))
-    {
-        free (buf);
-        return NULL;
-    }
-
     if (type != 2)
     {
         *message = buf;
-- 
cgit v1.2.3-70-g09d2