diff options
author | MadCamel <madcamel@gmail.com> | 2009-05-03 10:37:13 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-03 13:01:33 +0200 |
commit | 7642fdf488c5cd06363297ab88ef70b4f1caa4c6 (patch) | |
tree | 7a8ccc34829b16003af2847f93803a05916e9cd2 /src/map/tmw.c | |
parent | 1a284890a23188378db268500eb406f5505ff81b (diff) | |
download | tmwa-7642fdf488c5cd06363297ab88ef70b4f1caa4c6.tar.gz tmwa-7642fdf488c5cd06363297ab88ef70b4f1caa4c6.tar.bz2 tmwa-7642fdf488c5cd06363297ab88ef70b4f1caa4c6.tar.xz tmwa-7642fdf488c5cd06363297ab88ef70b4f1caa4c6.zip |
Fixed antispam to use a timer that doesn't wrap
Diffstat (limited to 'src/map/tmw.c')
-rw-r--r-- | src/map/tmw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/tmw.c b/src/map/tmw.c index 65c6a91..da43138 100644 --- a/src/map/tmw.c +++ b/src/map/tmw.c @@ -34,11 +34,12 @@ int tmw_CheckChatSpam(struct map_session_data *sd, char* message) { nullpo_retr(1, sd); + time_t now = time(NULL); if (pc_isGM(sd)) return 0; - if (gettick() > sd->chat_reset_due) { - sd->chat_reset_due = gettick() + battle_config.chat_spam_threshold; + if (now > sd->chat_reset_due) { + sd->chat_reset_due = now + battle_config.chat_spam_threshold; sd->chat_lines_in = 0; } @@ -50,7 +51,6 @@ int tmw_CheckChatSpam(struct map_session_data *sd, char* message) { sd->chat_lines_in += battle_config.chat_lame_penalty; // Penalty for lame, it can stack on top of the repeat penalty. - // Trade is automaticly lame. if (tmw_CheckChatLameness(sd, message)) sd->chat_lines_in += battle_config.chat_lame_penalty; |