Update others.cpp

This commit is contained in:
BenCat07 2018-02-25 13:20:07 +01:00 committed by GitHub
parent 2e66e877e9
commit aa404ba108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -692,6 +692,11 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
message.push_back(c);
}
}
static const char *lastfilter;
static bool retrun = false;
if (retrun)
PrintChat("%s: %s", name.c_str(), lastfilter);
retrun = false;
if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX)
{
if (!strcmp(chat_filter.GetString(), ""))
@ -798,6 +803,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
boost::replace_all(message2, "7", "t");
for (auto filter : res)
{
if (retrun)
break;
if (boost::contains(message2, filter))
{
@ -807,6 +814,10 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
clear += "\n";
}
chat_stack::Say(". " + clear, true);
PrintChat("%s: %s", 0xe05938, name.c_str(),
filter.c_str());
retrun = true;
lastfilter = filter.c_str();
}
}
}
@ -825,6 +836,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
boost::replace_all(message2, "7", "t");
for (auto filter : result)
{
if (retrun)
break;
if (boost::contains(message2, filter))
{
if (clear == "")
@ -834,6 +847,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
clear += "\n";
}
chat_stack::Say(". " + clear, true);
retrun = true;
}
}
}
@ -844,7 +858,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
{
if (ucccccp::validate(message))
{
PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(),
PrintChat("\x07%06X%s\x01: %s", name.c_str(),
ucccccp::decrypt(message).c_str());
}
}