Update others.cpp

This commit is contained in:
BenCat07 2018-02-17 16:43:51 +01:00 committed by GitHub
parent c0fe996b91
commit c516de51e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -657,7 +657,7 @@ static CatVar clean_chat(CV_SWITCH, "clean_chat", "0", "Clean chat",
"Removes newlines from chat"); "Removes newlines from chat");
static CatVar dispatch_log(CV_SWITCH, "debug_log_usermessages", "0", static CatVar dispatch_log(CV_SWITCH, "debug_log_usermessages", "0",
"Log dispatched user messages"); "Log dispatched user messages");
std::string clear = "";
bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
{ {
int loop_index, s, i, j; int loop_index, s, i, j;
@ -753,12 +753,11 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
if (tmp.size() > 2) if (tmp.size() > 2)
name2.push_back(tmp); name2.push_back(tmp);
iii = 0; iii = 0;
std::vector<std::string> res = { "skid", "script", "cheat", std::vector<std::string> res = {
"hak", "hac", "f1", "hax", "skid", "script", "cheat", "hak", "hac", "f1",
"vac", "ban", "lmao", "hax", "vac", "ban", "lmao", "bot", "report",
"bot", "report" "cat", "insta", "revv", "brass", "kick", claz
"cat", };
"kick", claz };
for (auto i : name2) for (auto i : name2)
{ {
boost::to_lower(i); boost::to_lower(i);
@ -776,11 +775,13 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
{ {
if (boost::contains(message2, filter)) if (boost::contains(message2, filter))
{ {
chat_stack::Say(". "
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" if (clear == "")
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" {
"\n ", for (int i = 0; i < 100; i++)
true); clear += "\n";
}
chat_stack::Say(". " + clear, true);
} }
} }
} }
@ -801,9 +802,13 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf)
{ {
if (boost::contains(message2, filter)) if (boost::contains(message2, filter))
{ {
chat_stack::Say( if (clear == "")
". \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n ", {
true); clear = "";
for (int i = 0; i < 100; i++)
clear += "\n";
}
chat_stack::Say(". " + clear, true);
} }
} }
} }