diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-25 04:05:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-25 04:05:15 +0300 |
commit | 2fe03b9dd2747c18afd89abd7440c7cb49b7efe5 (patch) | |
tree | e78c752b6d772b9b91e63d60d09bc9af70e025e8 /src/emap/pc.c | |
parent | 962383f1e1b62b667b982d0d923db1b6fdd5b833 (diff) | |
download | evol-hercules-2fe03b9dd2747c18afd89abd7440c7cb49b7efe5.tar.gz evol-hercules-2fe03b9dd2747c18afd89abd7440c7cb49b7efe5.tar.bz2 evol-hercules-2fe03b9dd2747c18afd89abd7440c7cb49b7efe5.tar.xz evol-hercules-2fe03b9dd2747c18afd89abd7440c7cb49b7efe5.zip |
Allow use colored messages in chat, even if # already used for gm commands.
Diffstat (limited to 'src/emap/pc.c')
-rw-r--r-- | src/emap/pc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/emap/pc.c b/src/emap/pc.c index c7203d0..42669ae 100644 --- a/src/emap/pc.c +++ b/src/emap/pc.c @@ -660,3 +660,39 @@ bool epc_adoption_pre(struct map_session_data *p1_sd, hookStop(); return true; } + +// copy from pc_process_chat_message +// exception only prevent call gm command if string start with ## +bool epc_process_chat_message_pre(struct map_session_data *sd, const char *message) +{ + if (message && strlen(message) > 2 && message[0] == '#' && message[1] == '#') + { + // do nothing + } + else if (atcommand->exec(sd->fd, sd, message, true)) + { + hookStop(); + return false; + } + + if (!pc->can_talk(sd)) + { + hookStop(); + return false; + } + + if (battle->bc->min_chat_delay != 0) + { + if (DIFF_TICK(sd->cantalk_tick, timer->gettick()) > 0) + { + hookStop(); + return false; + } + sd->cantalk_tick = timer->gettick() + battle->bc->min_chat_delay; + } + + pc->update_idle_time(sd, BCIDLE_CHAT); + + hookStop(); + return true; +} |