summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2008-10-31 22:09:41 +0000
committerJared Adams <jaxad0127@gmail.com>2008-10-31 22:09:41 +0000
commitff4ed0b105b016aa3a7dad07db5fb00456bbe822 (patch)
tree98202498bdf89b86d3469b25d4cf5d0e5022e690 /src/map/clif.c
parentb5c143b5ac5935dc7378dfb4314003e445efb5d1 (diff)
downloadtmwa-ff4ed0b105b016aa3a7dad07db5fb00456bbe822.tar.gz
tmwa-ff4ed0b105b016aa3a7dad07db5fb00456bbe822.tar.bz2
tmwa-ff4ed0b105b016aa3a7dad07db5fb00456bbe822.tar.xz
tmwa-ff4ed0b105b016aa3a7dad07db5fb00456bbe822.zip
Commit Mantis 521: Filter out Halloween `magic' from chat
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 8fc119e..ef5a72f 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7605,10 +7605,15 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
WBUFL(buf,4) = sd->bl.id;
memcpy(WBUFP(buf,8), RFIFOP(fd,4), RFIFOW(fd,2) - 4);
magic_status = magic_message(sd, buf, WBUFW(buf, 2));
- if (magic_status)
- sd->chat_threshold = 0; /* Don't treat repeated magic as spamming */
+ if (magic_status) {
+ sd->chat_threshold = 0;
+ sd->chat_repeatmsg -= 2;
- if (magic_status >= 0)
+ if (sd->chat_repeatmsg < 0)
+ sd->chat_repeatmsg = 0;
+ }
+
+ if (magic_status == 0)
clif_send(buf, WBUFW(buf,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
}